Comments (1)
You can hack this in by inheriting from DefaultGroup
and then overwrite the parse_arg()
function like so:
def parse_args(self, ctx, args):
if (not args or args in (["-h"], ["--help"])) and self.default_if_no_args:
args.insert(0, self.default_cmd_name)
return super(DefaultGroup, self).parse_args(ctx, args)
However, this will make it impossible to get the original help messaging containing all the subcommands. So your users will be unaware of the other commands available.
The ideal solution would be to somehow merge the help messages from both the default command and main group. But I'm not sure how to do that...
from click-default-group.
Related Issues (15)
- Default command name not used in help output HOT 2
- conflict with other extensions like click-help-colors HOT 1
- Shell completion (Commands) won't work for DefaultGroup
- 1.2.2: test suite is failing HOT 8
- Missing command error when providing only group options HOT 2
- Include tests in PyPI source tarball HOT 1
- Include LICENSE in PyPI tarball HOT 1
- Feature request: pure Python 3 wheel HOT 6
- Deprecation during install with latest version of `pip` HOT 15
- The `--` mechanism for splitting arguments doesn't get forwarded correctly HOT 6
- Accept the idea of @llchan
- click-default-group breaks click-repl HOT 1
- Thanks HOT 1
- How to provide `--version` option? HOT 1
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 click-default-group.