nushell / nushell/nu_scripts

Can't run `custom-completions/auro-generate` scripts

Open
#968 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Nushell
Stars
1.3k
Forks
323
Avg merge
2h 55m
Merged PRs (30d)
3

Description

Both doesn't work for me.

For parse-fish.nu the error is following:

> source parse-fish.nu
Error: nu::shell::variable_not_found

  × Variable not found
    ╭─[/home/mock/Downloads/nu_scripts/custom-completions/auto-generate/parse-fish.nu:6:35]
  5 │     # parse every .fish file in the current directory and make a .nu completions file of it
  6 │ ╭─▶ def build-completions-from-pwd [] {
  7 │ │       ls *.fish | par-each { |f|
  8 │ │           let out = ($f.name | str replace ".fish" ".nu")
  9 │ │           print $"building nushell completions from ($f.name)"
 10 │ │           build-completion $f.name $out
 11 │ │       }
 12 │ ├─▶ }
    · ╰──── variable not found
 13 │
    ╰────

For parse-help,nu:

> source parse-help.nu
> yay --help | parse-help | make-completion yay | save yay.nu
Error: nu::shell::eval_block_with_input

  × Eval block failed with pipeline input
   ╭─[/home/mock/Downloads/nu_scripts/custom-completions/auto-generate/parse-help.nu:6:11]
 5 │     # help format  '        -s,                      --long                   <format>                 description   '
 6 │     $in | parse -r '\s\s+(?:-(?P<short>\w)[,\s]+)?(?:--(?P<long>[\w-]+))\s*(?:<(?P<format>.*)>)?\s*(?P<description>.*)?'
   ·           ──┬──
   ·             ╰── source value
 7 │ }
   ╰────

Error: nu::shell::external_command

  × External command failed
    ╭─[/home/mock/Downloads/nu_scripts/custom-completions/auto-generate/parse-help.nu:13:13]
 12 │         build-string "\t--" $it.long (if ($it.short | is-empty) == false {
 13 │             build-string "(-" $it.short ")"
    ·             ──────┬─────
    ·                   ╰── Command `build-string` not found
 14 │         }) (if ($it.description | is-empty) == false {
    ╰────
  help: `build-string` is neither a Nushell built-in or a known external command

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported commands by sourcing custom-completions/auto-generate/parse-fish.nu and parse-help.nu. Start at the failing lines shown in each error, then verify that both scripts can be sourced and the demonstrated completion-generation pipelines run without errors.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.