I would like to have the ability to pass an argument w/o having to specify an option for optparse. If I do pass an option, it has to be a known option or else the script will fail.
Rsync the following file to destination
myscript.py filename
Rsync the following folder to destination (all this is figured out in function I create).
myscript.py -f foldername
The reason is, I have an array (or dict) that ties with the "foldername." If no options are passed, the argument given in the CLI is a file that's in the working folder where the user calls the script. Passing -f
means to upload a folder whose value is stored in a dict (user can be in any directory, this folder's path is known ahead of time).
Am I better off adding options for both options? -f
for file and -v
for folder aka version?