[issue22848] Subparser help does not respect SUPPRESS argument

2020-05-02 Thread Mitar
Change by Mitar : -- nosy: +mitar ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22848] Subparser help does not respect SUPPRESS argument

2018-05-18 Thread Andrew Gaul
Change by Andrew Gaul : -- nosy: +gaul ___ Python tracker ___ ___ Python-bugs-list mailing

[issue22848] Subparser help does not respect SUPPRESS argument

2018-05-06 Thread paul j3
paul j3 added the comment: I've attached a file that tries out the idea of building a custom `metavar` in the `add_parser` method. It subclasses argparse._SubParsersAction, and registers it with the parser. No other modification to production code is required.

[issue22848] Subparser help does not respect SUPPRESS argument

2018-05-03 Thread paul j3
paul j3 added the comment: I've reviewed the comments and proposed patch, and still think that the custom metavar is still the best fix. subparses.metavar can be changed after subparsers has been created. The programmer could, for example, write a simple helper function

[issue22848] Subparser help does not respect SUPPRESS argument

2018-05-02 Thread Floreal
Floreal added the comment: Will this patch be integrated in future days / weeks / years? I still want to add a hidden subparser, but doing this by editing manually the metavar of the subparsers is not a good solution... -- nosy: +floreal

[issue22848] Subparser help does not respect SUPPRESS argument

2016-09-22 Thread Drake Bridgewater
Changes by Drake Bridgewater : -- nosy: +Drake Bridgewater ___ Python tracker ___

[issue22848] Subparser help does not respect SUPPRESS argument

2015-04-22 Thread paul j3
paul j3 added the comment: A similar Stackoverflow question http://stackoverflow.com/questions/21692395/hiding-selected-subcommands-using-argparse/21712058#21712058 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22848

[issue22848] Subparser help does not respect SUPPRESS argument

2015-04-16 Thread paul j3
paul j3 added the comment: It'll take me a while to work through this proposed patch. My first reaction is that I am uncomfortable with adding an attribute to all parsers just to implement this help feature. For one thing it seems to cross functionality boundaries. I need to review how

[issue22848] Subparser help does not respect SUPPRESS argument

2015-04-16 Thread paul j3
paul j3 added the comment: Giving the `subparsers` Action a `metavar` might achieve everything the proposed patch does - without any code changes. In the 1st test case: subparsers = parser.add_subparsers(title='subcommands',

[issue22848] Subparser help does not respect SUPPRESS argument

2015-04-15 Thread Matt Long
Matt Long added the comment: I prefer the idea of help=SUPPRESSED resulting in a hidden subcommand. That is, one that does not show up at all in the usage/help output: import argparse parser = argparse.ArgumentParser(prog='myapp') parser.add_argument('--foo', action=CustomAction)

[issue22848] Subparser help does not respect SUPPRESS argument

2015-04-15 Thread Matt Long
Matt Long added the comment: Here's a patch for the proposal in my previous comment. As Barry mentioned, it wasn't as straightforward as I had hoped due to parts of the usage text being generated by the state of both self._name_parser_map and self._choices_actions. -- Added file:

[issue22848] Subparser help does not respect SUPPRESS argument

2015-04-15 Thread R. David Murray
R. David Murray added the comment: This patch looks good to me, but I did not go through the argparse logic fully. Paul, can you review this and make sure itliteral_eval makes sense? There is a small concern about user code that provides a Mapping for choices having an attribute collision

[issue22848] Subparser help does not respect SUPPRESS argument

2015-04-14 Thread R. David Murray
R. David Murray added the comment: I believe BJ is saying the same thing that Paul is, that SUPPRESS could omit the subparser from the list of subparsers. I haven't checked, but I believe this means that the proposed patch doesn't do anything other than what omitting the help would do, so a

[issue22848] Subparser help does not respect SUPPRESS argument

2015-02-19 Thread BJ Dierkes
BJ Dierkes added the comment: I would like to add to this regarding the following: [QUOTE] Why would a user want to use `help=argparse.SUPPRESS`, as opposed to simply omitting the `help` parameter? The effect would be the same as your patch. [/QUOTE] This actually isn't the case, if you

[issue22848] Subparser help does not respect SUPPRESS argument

2014-12-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Targetting to 3.5 and nosying myself. It would be nice if it were possible to suppress the help of an entire subparser, but I took a quick look at the code and it seems tricky. -- nosy: +barry versions: +Python 3.5 -Python 2.7

[issue22848] Subparser help does not respect SUPPRESS argument

2014-11-14 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- nosy: +bethard ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22848 ___ ___ Python-bugs-list mailing

[issue22848] Subparser help does not respect SUPPRESS argument

2014-11-12 Thread Brett Hannigan
Changes by Brett Hannigan bhanni...@dnanexus.com: -- keywords: +patch Added file: http://bugs.python.org/file37187/argparse.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22848 ___

[issue22848] Subparser help does not respect SUPPRESS argument

2014-11-12 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +paul.j3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22848 ___ ___ Python-bugs-list

[issue22848] Subparser help does not respect SUPPRESS argument

2014-11-12 Thread paul j3
paul j3 added the comment: A notational point - you are adding a subparser, not an argument, to the subparsers action. Why would a user want to use `help=argparse.SUPPRESS`, as opposed to simply omitting the `help` parameter? The effect would be the same as your patch. Another

[issue22848] Subparser help does not respect SUPPRESS argument

2014-11-11 Thread Brett Hannigan
New submission from Brett Hannigan: When adding an argument to a subparser and passing help=argparse.SUPPRESS, I would expect this argument to not show up when running help. Instead, I find that the argument is listed and the help given is ==SUPPRESS==. For example (also in attached python

[issue22848] Subparser help does not respect SUPPRESS argument

2014-11-11 Thread Brett Hannigan
Changes by Brett Hannigan bhanni...@dnanexus.com: Added file: http://bugs.python.org/file37178/argparse.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22848 ___