Another option is to use shlex.split. It it especially very convenient if you have real CLI arguments string:
import shlex
argString = '-vvvv -c "yes" --foo bar --some_flag'
args = parser.parse_args(shlex.split(argString))
Another option is to use shlex.split. It it especially very convenient if you have real CLI arguments string:
import shlex
argString = '-vvvv -c "yes" --foo bar --some_flag'
args = parser.parse_args(shlex.split(argString))