~skeeto/public-inbox

1

Conventions for Command Line Options

Frank P Esposito
Details
Message ID
<CAFqEa-Am9tpf7yHd5ZXR0jGfjBac8-dybAZx14PWjK=UW7-R1w@mail.gmail.com>
DKIM signature
pass
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?
Details
Message ID
<20200803184304.7kc6jvsoywg7arjw@nullprogram.com>
In-Reply-To
<CAFqEa-Am9tpf7yHd5ZXR0jGfjBac8-dybAZx14PWjK=UW7-R1w@mail.gmail.com> (view parent)
DKIM signature
missing
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.
Export thread (mbox)