3👍
✅
The line store_true
will cause the command to store the boolean value True
if the argument --username
is given, rather then storing the next value.
I suspect that doing something along the lines of action='store'
would do what you expect.
I think you’re currently using optparse, correct? If so, you can find a full listing of the different kinds of actions available in the optparse documentation.
Source:stackexchange.com