Skip to content

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

Open

Description

@RReverser

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 │ ]
     ╰────

Activity

  1. RReverser commented on Jun 23, 2022

    @RReverser
    Author

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

  2. changed the title [-]Auto-generated curl.nu has a syntax error[/-] [+]Some auto-generated completions use invalid syntax ...args[/+] on Jun 23, 2022
  3. RReverser commented on Jun 23, 2022

    @RReverser
    Author

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

  4. fdncred commented on Jun 23, 2022

    @fdncred
    Contributor

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

  5. RReverser commented on Jun 23, 2022

    @RReverser
    Author

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

  6. fdncred commented on Jun 23, 2022

    @fdncred
    Contributor

    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

  7. RReverser commented on Jun 23, 2022

    @RReverser
    Author

    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.

  8. LoicRiegel commented on Aug 26, 2024

    @LoicRiegel
    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...

  9. added a commit that references this issue on Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions