I am writing a small program that should execute a command on a remote server (suppose this is a pretty dumb shell around ssh [hostname] [command]).
I want to execute it as such:
./floep [command]
However, I need to pass certain command lines from time to time:
./floep -v [command]
so I decided to use optparse.OptionParser for this. The problem is that sometimes a command has an argument that works fine if I do:
./floep -v "uname -a"
But I also want it to work when I use:
./floep -v uname -a
The idea is that as soon as I came across the first argument without an option, everything after that should be part of my team.
This, however, gives me:
Usage: floep [options]
floep: error: no such option: -a
OptionParser ? : ?
: ?