Conventions for Command Line Options

Frank P Esposito
Message ID
DKIM signature
Download raw message
Hello – I not a python expert but looking at the various
implementations of getopt from C code to how the BASH shell does it  —
one item that I am not clear about is when a short option is an
alternative to a long option, ie -o and –output for an output file. So
my question is if I wanted to test to see if “output” was specified,
does the code require to test for both the long and short option just
the long or short option – if both are set, which one wins?
Message ID
<CAFqEa-Am9tpf7yHd5ZXR0jGfjBac8-dybAZx14PWjK=UW7-R1w@mail.gmail.com> (view parent)
DKIM signature
Download raw message
Typically the long and short options are associated and so the option 
parser treats them as if they were the same option. The program should 
not care which form, short or long, was actually used, and typically 
there's no way to tell.
Reply to thread Export thread (mbox)