Hi.
I am trying to use optparse but I am having a problem.
My script usage would be: script <filename>
I don't intend to add any option string, such as: script -f <filename>
or script --file <filename>
Is there any way I can choose not to pass an argument string? Or is there any way I can allow the user to do this:
script -f <filename>
script --filename <filename>
script <filename>
All of the above with the same consequence?
I know that I can easily do with this with using argv[1]
but the thing is that I might need to add command line support later in the project and add that time I would not want to add optparse
support all over. That is the reason I want to use optparse
.