I'm writing a differ. The command line needs to handle two files - left and right. I would like the synapsis to be like this:
differ.py [-f] FILE1 [[-t] FILE2]
WHERE -f
is the option that accepts FILE1, -t
accepts FILE2.
FILE1 is mandatory, FILE2 can be read from stdin or real file. I would like it to be used like this:
differ.py myfile1
differ.py myfile1 myfile2
differ.py myfile1 -t myfile2
differ.py -f myfile1
differ.py -f myfile1 myfile2
differ.py -f myfile1 -t myfile2
Is it possible with argparse
module? If so, then how?
Thanks in advance.