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
Generate the Nushell completion script: (Under
bash)xh --generate complete-nushell > ~/.local/share/nushell/completions/xh.nuImport the completion module in Nushell:
use xh.nu *Run any
--generatecommand: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
Environment
- OS: Rocky Linux 10.2
- XH version:
$ xh --version xh 0.26.2 -native-tls +rustls - Nushell:
$ nu -v 0.114.1
Source: ducaale/xh