nu_scripts icon indicating copy to clipboard operation
nu_scripts copied to clipboard

Some auto-generated completions use invalid syntax ...args

Open RReverser opened this issue 3 years ago • 7 comments

Trying to load curl.nu fails at

https://github.com/nushell/nu_scripts/blob/7d5c2f0a2e004b10727cdd6a0a5a0911cc54de9c/custom-completions/auto-generate/completions/curl.nu#L454 with

Error: nu::parser::unexpected_eof (link)

  × Unexpected end of code.
     ╭─[C:\Users\me\Documents\nu_scripts\custom-completions\auto-generate\completions\curl.nu:454:1]
 454 │  ...args
 455 │ ]
     ╰────

RReverser avatar Jun 23 '22 16:06 RReverser

Same error in ffmpeg.nu and less.nu (and probably others).

RReverser avatar Jun 23 '22 16:06 RReverser

ffmpeg.nu is actually completely empty except for ...args; I suppose it's because it uses non-standard parameter format (-something instead of -s or --something).

RReverser avatar Jun 23 '22 16:06 RReverser

...args is a thing. it's an array of parameters that can be iterated through.

fdncred avatar Jun 23 '22 17:06 fdncred

I only know that I'm getting a syntax error when trying to load those files and it always points at ...args 🤷‍♂️

RReverser avatar Jun 23 '22 17:06 RReverser

apparently, there's a problem but ...args is a thing as shown here:

def test [...args] {
  $args | str collect
}
> test 1 2 three
12three

some investigation needs to happen to see what the problem may be

fdncred avatar Jun 23 '22 17:06 fdncred

Even weirder that 7z.nu works fine, but ffmpeg.nu doesn't even though they are very similar structurally...

UPD: ah ok, for some reason ffmpeg.nu has extra pair of brackets [ ... ] around each extern definition, but that's probably a separate problem since curl.nu doesn't have those.

RReverser avatar Jun 23 '22 21:06 RReverser