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

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

Open
RReverser opened this issue Jun 23, 2022 · 7 comments
Open

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

RReverser opened this issue Jun 23, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@RReverser
Copy link

RReverser commented Jun 23, 2022

Trying to load curl.nu fails at

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
Copy link
Author

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

@RReverser RReverser changed the title Auto-generated curl.nu has a syntax error Some auto-generated completions use invalid syntax ...args Jun 23, 2022
@RReverser
Copy link
Author

RReverser commented Jun 23, 2022

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).

@fdncred
Copy link
Collaborator

fdncred commented Jun 23, 2022

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

@RReverser
Copy link
Author

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

@fdncred
Copy link
Collaborator

fdncred commented Jun 23, 2022

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 fdncred added the bug Something isn't working label Jun 23, 2022
@RReverser
Copy link
Author

RReverser commented Jun 23, 2022

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.

@LoicRiegel
Copy link
Contributor

It really looks like the problem is those extra pair of brackets. The error is gone as soon as you remove them. Search for [# in the folder and you will find other files that have those brackets, like apt-build.nu, gprof.nu...
Removing those brackets manually might not be the best idea, since they might be back the next time someone runs the auto-compete script again...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants