How to determine 3 scenarios using the same switch -f in the same script using argparse, say script is called script.py
-
just run the scirpt no -f switch
script.py
-
-f is passed but no argument
script.py -f
-
-f is passed and has a argunment too
script.py -f /tmp/blabla
I tried but looks like one or the other works but not all these 3 scenarios.