nushell / nu_scripts

A place to share Nushell scripts with each other
MIT License
737 stars 227 forks source link

winget-completions.nu with problems? #623

Closed Heart1010 closed 6 months ago

Heart1010 commented 1 year ago

I've tried to use the winget-completions.nu completions in my config

use C:\Users\username\git-completions.nu *

but when I now start nushell I'm getting the following error:

Error: nu::parser::unknown_command

  × Unknown command.
    ╭─[C:\Users\username\winget-completions.nu:11:1]
 11 │ export extern "winget install" [
 12 │     query?: string@"nu-complete winget install name",
    ·                    ────────────────┬────────────────
    ·                                    ╰── unknown command
 13 │     --query(-q): string@"nu-complete winget install name", # The query used to search for a package
    ╰────

https://github.com/nushell/nu_scripts/blob/694701430662f08071cc1b88cb3fa438539c39ea/custom-completions/winget/winget-completions.nu#L11

fdncred commented 1 year ago

The winget completions probably need to be updated. I think it's been a while since anyone has looked at it. Feel free to find out what's wrong and submit a PR. Thanks!

Heart1010 commented 1 year ago

I'm totally new to nu scripts but only by re-ordering all the def blocks to the top of the file fixed it for me.

godrja commented 6 months ago

@Heart1010 could you please check if the latest version of nu_scripts fixes this problem for you? (Related PR)

Heart1010 commented 6 months ago

@Heart1010 could you please check if the latest version of nu_scripts fixes this problem for you? (Related PR)

Perfect - it's working now! Thanks 👍