Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run custom-completions/auro-generate scripts #968

Open
mock1328 opened this issue Oct 4, 2024 · 1 comment
Open

Can't run custom-completions/auro-generate scripts #968

mock1328 opened this issue Oct 4, 2024 · 1 comment

Comments

@mock1328
Copy link

mock1328 commented Oct 4, 2024

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
@fdncred
Copy link
Collaborator

fdncred commented Oct 4, 2024

It was written years ago now and probably needs to be updated to more recent nushell syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants