Closed rschmidtner closed 2 months ago
"--" is a standard convention for command-line processing. It means "stop handling options for all subsequent command-line arguments". Consider: what if you wanted to use grep
to find the string -i
in a file? You'd have to somehow convince grep to not read that as "perform a case-insensitive search". You'd do that with "--".
In the case of Appeal, Appeal itself consumes the "--"; it doesn't pass it on to a converter. But all subsequent command-line arguments are passed on as positional arguments, even if they start with dashes.
With your sample program, if you wanted a
to get the value --
from the command-line, just specify it twice:
% python script.py f -- --
(It's not necessary to put quote marks around the two dashes.)
Or to pass in -a
or --longfellow
to a
:
% python script.py f -- -a
% python script.py f -- --longfellow
Why does
python script.py f "--"
not work?