Re: argparse: use of double dash to separate options and positional arguments

2015-11-06 Thread Random832
Peter Otten <__pete...@web.de> writes: > I'm not sure about this one; one purpose of REMAINDER is to pass on the > unprocessed arguments to another program/script, and this might follow the > same convention. Should > > parser.add_argument('-v', '--verbose', action='store_true') > parser.add_arg

Re: argparse: use of double dash to separate options and positional arguments

2015-11-06 Thread Peter Otten
Amit Ramon wrote: > Peter Otten <__pete...@web.de> [2015-11-06 11:57 +0100]: > > >>> >>> For example, with the above code >>> >>> my_prog -v hello world >>> >>> works well, but >>> >>> my_prog -v -x hello world >>> >>> Fails with an error message 'error: unrecognized arguments: -x'. >> >

Re: argparse: use of double dash to separate options and positional arguments

2015-11-06 Thread Amit Ramon
Peter Otten <__pete...@web.de> [2015-11-06 11:57 +0100]: For example, with the above code my_prog -v hello world works well, but my_prog -v -x hello world Fails with an error message 'error: unrecognized arguments: -x'. This looks like a bug to me. Please report it on bug.python.

Re: argparse: use of double dash to separate options and positional arguments

2015-11-06 Thread Peter Otten
Amit Ramon wrote: > Hello, > > I'm trying to use argparse in a program that gets some options and > positional arguments. I want to collect all the positional arguments > in a single argument using the REMAINDER option to add_argument() as > shown bellow: > > parser = argparse.ArgumentParser

argparse: use of double dash to separate options and positional arguments

2015-11-06 Thread Amit Ramon
Hello, I'm trying to use argparse in a program that gets some options and positional arguments. I want to collect all the positional arguments in a single argument using the REMAINDER option to add_argument() as shown bellow: parser = argparse.ArgumentParser(description='Test argparse') pa