So I have a parser set up like such:
parser.add_argument('-f', '--foo', metavar='foo', type=ast.literal_eval, default=[], help="Foo")
And I need to let users enter multiple values if they so desire:
$ python3 foo.py -f [0x01, 0x56, 0xff] -a blah -b blah ...
But whenever I try more than one value in the list I get an EOF error:
...
File "<unknown>", line 1
[0x01,
^
SyntaxError: unexpected EOF while parsing
What's the proper way to set up the parser to handle something like this?