#473·xh

xh.nu completion script causes parser error on --generate flags in Nushell (nu::parser::missing_positional)

Author: zero00072Created Jul 30, 2026Updated Aug 25, 2026

Describe the bug

When sourcing the generated Nushell completion script (xh.nu) via use xh.nu *, executing valid commands like xh --generate man fails at the Nushell parser level with Error: nu::parser::missing_positional.

This happens because the parameter definition in xh.nu marks raw_method_or_url as a required positional argument, which prevents Nushell from parsing subcommands/flags that do not expect a URL or method argument.

To Reproduce

  1. Generate the Nushell completion script: (Under bash)

    bash
    xh --generate complete-nushell > ~/.local/share/nushell/completions/xh.nu 
  2. Import the completion module in Nushell:

    nushell
    use xh.nu *
  3. Run any --generate command:

    bash
    xh --generate man

Expected behavior

The command xh --generate man should successfully output the man page documentation without being blocked by Nushell's parameter parser.

Actual behavior

Image

Environment

  • OS: Rocky Linux 10.2
  • XH version:
    bash
    $ xh --version
    xh 0.26.2
    -native-tls +rustls
  • Nushell:
    bash
    $ nu -v
    0.114.1