nushell / nushell/nushell.github.io

Possibly erroneous code example in overlays.md

Offen
#1,947 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
258
Forks
561
Ø Merge
3 Std. 20 Min.
Gemergte PRs (30 T.)
15

Beschreibung

The following excerpt is from overlays.md:

Removing an Overlay

If you don't need the overlay definitions anymore, call overlay hide:

(spam)> overlay hide spam

(zero)> foo
Error: Can't run executable...

(zero)> overlay list
───┬──────
 0 │ zero
───┴──────

The overlays are also scoped.
Any added overlays are removed at the end of the scope:

(zero)> do { overlay use spam; foo }  # overlay is active only inside the block
foo

(zero)> overlay list
───┬──────
 0 │ zero
───┴──────

In the second code block, running the scoped code example leads to this:

❯ do { overlay use spam; foo }
Error: nu::shell::external_command

  × External command failed
   ╭─[entry #33:1:24]
 1 │ do { overlay use spam; foo }
   ·                        ─┬─
   ·                         ╰── Command `foo` not found
   ╰────
  help: A command with that name exists in module `spam`. Try importing it with `use`

I imagine this is due to the parsing stage not recognizing the foo command since it currently isn't in scope. I assume this is by design and it's the docs that fail to mention this. Perhaps we should modify the example to prevent confusion? Or perhaps I may have missed something. Please let me know. Thanks!

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem Scoped-Overlay-Beispiel in overlays.md und führe es in Nushell aus, um das gemeldete Verhalten zu bestätigen. Prüfe, ob das Beispiel oder seine Erklärung ungenau ist, und aktualisiere anschließend overlays.md so, dass der dokumentierte Befehl und das erwartete Ergebnis mit dem beobachteten Verhalten übereinstimmen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
shell
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.