Comments (9)
In Python at least, it was recommended to turn off the help of the parent to avoid this sort of thing. Perhaps try addHelp: false
in the parent parser options?
from argparse.
Yes. This is the workaround i use for the moment. But this will not create a --help option for the parent command.
from argparse.
Funny enough, I just came across a use case that I think I need for myself, so perhaps I'll see if I can try fixing it.
from argparse.
Is this case specific to js-port or the same in upstream? If the same - should no be reported here.
from argparse.
Interesting question. What role does js-port
play here? Is that the mechanism or tool used to port the python implementation to javascript?
from argparse.
import argparse
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest='command')
subparsers1 = subparsers.add_parser('1')
subparsers2 = subparsers.add_parser('2', parents=[subparsers1])
args = parser.parse_args()
argparse.ArgumentError: argument -h/--help: conflicting option strings: -h, --help
same error for Python 3.8.5 argparse==1.4.0
from argparse.
Interesting question. What role does
js-port
play here? Is that the mechanism or tool used to port the python implementation to javascript?
Just a term. This package is ported manually, with all benefits and disadvantages of original.
from argparse.
same error for Python 3.8.5 argparse==1.4.0
Let's close then. I've added issue template with clarifications https://github.com/nodeca/argparse/blob/master/.github/ISSUE_TEMPLATE.md.
We are not experts about how to use argparse, we focused on how to make this package close to original. StackOverflow already has all possible recipes for python, which can be used here.
from argparse.
Thanks for clarifying, I understand what you meant now, and since it fails it python implementation than it makes sense that this is not a bug here.
from argparse.
Related Issues (20)
- add_argument fails to fail when provided with invalid arguments HOT 1
- Implementation of default and required are inconsistent with Python implememtation. HOT 1
- Is there a way to generate a tab completions bash script? HOT 4
- v2 cannot be used with ts-node anymore HOT 2
- How to properly fix "nargs for store actions must be != 0" error? HOT 13
- exit_on_error does not work, program still exit. HOT 1
- exit_on_error 'false' flag not respected when error in positional arguments HOT 2
- Node exception: syntax error in argparse.js: "syntax error: unexpected token {" HOT 1
- Question about the license change HOT 6
- Update to License of Python v2.0.1 HOT 4
- License not applicable? HOT 2
- Should the license be Python-2.0 or PSF-2.0? HOT 12
- Using in non-command line app? HOT 1
- How to make a custom Action? HOT 5
- TypeError: _StoreTrueAction() got an unexpected keyword argument 'metavar' HOT 1
- Please add defaultValue usage example HOT 9
- Coming from Commander
- ArgumentParser exits when met with an invalid argument
- npm packages out of sync: argparse and @types/argparse HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argparse.