Command line argument when starting the CLI #1175
|
I would like to pass a command line argument to my CLI when starting it - the IP address of the server to connect to. Something like this (running in Windows PowerShell):
In the main loop, I have some code to grab the argument before even starting the command parser: But when I run this, I get an error:
How do I pass the IP address like this and have the command parser ignore it? |
Replies: 1 comment 5 replies
|
|
cmd2.Cmd.__init__has a slightly misleading parameter calledallow_cli_args. You need to set that toFalseif you are processing your own command line args.