aura
aura copied to clipboard
Option parsing issues with `--` delimiter (double dash, two dashes)
i recently ran into an options parsing issue with aura when attempting to query the official repositories for -font.
Since the query -font starts with a dash -, i cannot run aura -Ss -font as it would be equivalent to aura -S -s -f -o -n -t, where every letter of the query is interpreted as an option. That means i need to signify the end of options, for -font to be treated as an operand. I'm used to doing this with --, but -- does not work for me in aura.
$ pacman -Ss -font
error: invalid option '-f'
$ pacman -Ss -- -font
community/ttf-terminus-nerd 2.3.3-2
Patched font Terminus (Terminess) from nerd fonts library
community/ttf-tinos-nerd 2.3.3-2
Patched font Tinos from nerd fonts library
community/ttf-ubuntu-font-family 0.83-8
Ubuntu font family
community/ttf-ubuntu-mono-nerd 2.3.3-2
$ aura -Ss -- -font
error: invalid option '-f'
The -- behavior is present in pacman and many other cli programs, but is evidently missing in AURA Version 3.2.9.
References:
Mentioned in bash(1) man-page under SHELL BUILTIN COMMANDS:
Unless otherwise noted, each builtin command documented in this section as accepting options preceded by - accepts -- to signify the end of the options.
And in the latest POSIX standard under 12. Utility Conventions->12.2 Utility Syntax Guidelines:
... Guideline 10: The first -- argument that is not an option-argument should be accepted as a delimiter indicating the end of options. Any following arguments should be treated as operands, even if they begin with the '-' character. ...
aura 4.0.0-alpha6 suffers from the same bug, although the underlying cause is probably different, as -- seems to be recognized in some capacity.
$ aura --version
aura-pm 4.0.0-alpha6
$ aura -Ss -font
error: Found argument '-f' which wasn't expected, or isn't valid in this context
If you tried to supply `-f` as a value rather than a flag, use `-- -f`
USAGE:
aura {sync|--sync|-S} [OPTIONS] [PACKAGES]...
For more information try --help
$ aura -Ss -- -font
error: The argument '--search <terms>' requires a value but none was supplied
For more information try --help
Confirmed that it also failed on Aura 4, even with -font wrapped in quotes! Attempts to use the long variant --search with = also didn't succeed.
Hi there, I'm sorry that this took so long to address. It's now possible to do aura -Ss -- -font and get the output you were expecting.