[issue29626] Issue with spacing in argparse module while using help

2017-05-28 Thread paul j3
paul j3 added the comment: I don't anticipate any backward compatibility issues with the proposed patch. But at the same time it feels almost too trivial of an issue to merit a patch. A short metavar such as `metavar="ID"' or even `metavar="_"' would be nearly as compact, and still leave

[issue29626] Issue with spacing in argparse module while using help

2017-05-28 Thread R. David Murray
R. David Murray added the comment: If I'm interpreted what the OP wrote correctly, he wanted the help text to not show that the option takes an argument, but instead rely on the help text to show that. That works for the option text, but it doesn't work for the synopsis (the synopsis is just

[issue29626] Issue with spacing in argparse module while using help

2017-05-27 Thread Cheryl Sabella
Cheryl Sabella added the comment: I submitted a PR for this based on paul.j3's suggested change: def _format_action_invocation(self, action): for option_string in action.option_strings: if len(args_string)>0: parts.append('%s

[issue29626] Issue with spacing in argparse module while using help

2017-05-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Does an empty metavar make sense? This makes the option with argument non-distinguising from the option without argument. -- nosy: +serhiy.storchaka ___ Python tracker

[issue29626] Issue with spacing in argparse module while using help

2017-05-27 Thread R. David Murray
Changes by R. David Murray : -- nosy: +r.david.murray ___ Python tracker ___ ___

[issue29626] Issue with spacing in argparse module while using help

2017-05-27 Thread Cheryl Sabella
Changes by Cheryl Sabella : -- pull_requests: +1918 ___ Python tracker ___ ___

[issue29626] Issue with spacing in argparse module while using help

2017-02-27 Thread paul j3
Changes by paul j3 : -- status: closed -> open ___ Python tracker ___ ___

[issue29626] Issue with spacing in argparse module while using help

2017-02-27 Thread paul j3
paul j3 added the comment: Sorry, I missed that. For some reason I looking something bigger. That's coming from the `metavar=""'. If I specify `metavar="xxx" that help line will have -p xxx, --projectid xxx Replace the 'xxx` with '', and you still have space between '-p' and ','. Now

[issue29626] Issue with spacing in argparse module while using help

2017-02-27 Thread Falguniben Jhaveri
Falguniben Jhaveri added the comment: There is an extra spacing here if you look carefully. I have commented above the code. Similarly it happens for "-o" too but not for other alphabets. 1427:~/mypy/argdev$ python3 issue29626.py delete -h usage: cli delete [-h] [-p] userid Deletes a user in

[issue29626] Issue with spacing in argparse module while using help

2017-02-27 Thread paul j3
paul j3 added the comment: This help looks normal: 1427:~/mypy/argdev$ python3 issue29626.py delete -h usage: cli delete [-h] [-p] userid Deletes a user in your organization. positional arguments: userid The userid of user. optional arguments: -h, --help show this

[issue29626] Issue with spacing in argparse module while using help

2017-02-27 Thread Falguniben Jhaveri
Falguniben Jhaveri added the comment: Sample code to repro this: import argparse parser = argparse.ArgumentParser(prog='cli') subparsers = parser.add_subparsers(dest="command") subparsers_user_delete = subparsers.add_parser("delete", help="Deletes a user in your organization.",

[issue29626] Issue with spacing in argparse module while using help

2017-02-27 Thread paul j3
paul j3 added the comment: With this setup import argparse parser=argparse.ArgumentParser(prog='cli') parser.add_argument('nodes') sp=parser.add_subparsers() p1 = sp.add_parser('list', description='Lists nodes in your current project') p1.add_argument('-p','--projectid', action='store_true')

[issue29626] Issue with spacing in argparse module while using help

2017-02-27 Thread paul j3
Changes by paul j3 : -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue29626] Issue with spacing in argparse module while using help

2017-02-22 Thread paul j3
paul j3 added the comment: We need to see the parser setup as well. I've never seen a bug like this before. The `usage` line suggests that you are using subparsers. It might be better if you asked this on StackOverFlow with a repeatable code example. That's a better place to get debugging

[issue29626] Issue with spacing in argparse module while using help

2017-02-22 Thread Falguniben Jhaveri
New submission from Falguniben Jhaveri: When I use argparse the optional arguments with character "-p" and "-s" has improper spacing while using help/usage command. Sample out put from argparse module: usage: cli node list [-h] [-p] [-o] Lists nodes in your current project. optional