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

Nushell Error: Automatically spreading lists is deprecated #285

Closed
TheJiahao opened this issue Jan 14, 2024 · 0 comments · Fixed by #286
Closed

Nushell Error: Automatically spreading lists is deprecated #285

TheJiahao opened this issue Jan 14, 2024 · 0 comments · Fixed by #286

Comments

@TheJiahao
Copy link

With Nushell 0.89.0, the completion script generated by argc --argc-completions nushell causes error:

Error:   × Automatically spreading lists is deprecated
   ╭─[<pathToArgc>\argc-completions\tmp\argc-completions.nu:1:1]
 1  def _argc_completer [args: list<string>] {
 2      argc --argc-compgen nushell "" $args
   ·                                    ──┬──
   ·                                      ╰── Spreading lists automatically when calling external commands is deprecated and will be removed in 0.91.
 3          | split row "\n" | range 0..-2
   ╰────
  help: Use the spread operator (put a '...' before the argument)

Possible solution (breaking change)

Use spread operator (added in Nushell 0.89.0, won't work in previous versions) in ...$args.

def _argc_completer [args: list<string>] {
argc --argc-compgen nushell "" $args
| split row "\n" | range 0..-2
| each { |line| $line | split column "\t" value description } | flatten
}

def _argc_completer [args: list<string>] {
    argc --argc-compgen nushell "" ...$args
        | split row "\n" | range 0..-2 
        | each { |line| $line | split column "\t" value description } | flatten 
}
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

Successfully merging a pull request may close this issue.

1 participant