[issue35480] argparse: add a full fledged parser as a subparser

2018-12-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I presume you mean to close this.

--
nosy: +terry.reedy
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35480] argparse: add a full fledged parser as a subparser

2018-12-12 Thread Victor Porton


Victor Porton  added the comment:

Oh, I noticed I can do

my_subparser = subparsers.add_parser('checkout', aliases=['co'])

So resolution invalid.

--
resolution:  -> not a bug

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35480] argparse: add a full fledged parser as a subparser

2018-12-12 Thread Victor Porton


New submission from Victor Porton :

Subparsers are added like:

subparsers.add_parser('checkout', aliases=['co'])

But I want to use a parser BOTH as a subparser and as a full-fledged parser.

It is because my program should understand both of the following command line 
options:

boiler chain -t http://www.w3.org/1999/xhtml -W inverseofsum

and

boiler pipe 'chain -t http://www.w3.org/1999/xhtml -W inverseofsum + 
transformation http://example.com/ns1'.

I split it (at +) into several lists of arguments as explained in 
https://stackoverflow.com/a/53750697/856090

So I need `chain` both as a subparser and as a standalone parser of `-t 
http://www.w3.org/1999/xhtml -W inverseofsum`.

So, feature which I want:

subparsers.add_parser('checkout', aliases=['co'], parser=...)

where ... is a reference to a parser object.

--
components: Library (Lib)
messages: 331730
nosy: porton
priority: normal
severity: normal
status: open
title: argparse: add a full fledged parser as a subparser
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com