Name | click-default-group JSON |
Version |
1.2.4
JSON |
| download |
home_page | |
Summary | click_default_group |
upload_time | 2023-08-04 07:54:58 |
maintainer | |
docs_url | None |
author | |
requires_python | >=2.7 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
|
coveralls test coverage |
No coveralls.
|
Click Default Group
===================
`DefaultGroup` is a sub class of [`click.Group`](https://click.pocoo.org/6/api/#click.Group). But it invokes a default
subcommand instead of showing a help message when a subcommand is not passed.
[![Build Status](https://img.shields.io/travis/click-contrib/click-default-group.svg)](https://travis-ci.org/click-contrib/click-default-group)
[![Coverage Status](https://img.shields.io/coveralls/click-contrib/click-default-group.svg)](https://coveralls.io/r/click-contrib/click-default-group)
Usage
-----
Define a default subcommand by `default=NAME`:
```python
import click
from click_default_group import DefaultGroup
@click.group(cls=DefaultGroup, default='foo', default_if_no_args=True)
def cli():
pass
@cli.command()
def foo():
click.echo('foo')
@cli.command()
def bar():
click.echo('bar')
```
Then you can invoke that without explicit subcommand name:
```console
$ cli.py --help
Usage: cli.py [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Command:
foo*
bar
$ cli.py
foo
$ cli.py foo
foo
$ cli.py bar
bar
```
Compatibility
-------------
`click-default-group` is compatible with these Click versions:
- Click-7.0
- Click-6.x
- Click-5.1
- Click-5.0
- Click-4.1
- Click-4.0
See the [latest build status](https://travis-ci.org/click-contrib/click-default-group)
at Travis CI.
Licensing
---------
Written by [Heungsub Lee], and distributed under the [BSD 3-Clause] license.
[Heungsub Lee]: https://subl.ee/
[BSD 3-Clause]: https://opensource.org/licenses/BSD-3-Clause
Raw data
{
"_id": null,
"home_page": "",
"name": "click-default-group",
"maintainer": "",
"docs_url": null,
"requires_python": ">=2.7",
"maintainer_email": "",
"keywords": "",
"author": "",
"author_email": "Heungsub Lee <heungsub@subl.ee>",
"download_url": "https://files.pythonhosted.org/packages/1d/ce/edb087fb53de63dad3b36408ca30368f438738098e668b78c87f93cd41df/click_default_group-1.2.4.tar.gz",
"platform": null,
"description": "Click Default Group\n===================\n\n`DefaultGroup` is a sub class of [`click.Group`](https://click.pocoo.org/6/api/#click.Group). But it invokes a default\nsubcommand instead of showing a help message when a subcommand is not passed.\n\n[![Build Status](https://img.shields.io/travis/click-contrib/click-default-group.svg)](https://travis-ci.org/click-contrib/click-default-group)\n[![Coverage Status](https://img.shields.io/coveralls/click-contrib/click-default-group.svg)](https://coveralls.io/r/click-contrib/click-default-group)\n\nUsage\n-----\n\nDefine a default subcommand by `default=NAME`:\n\n```python\nimport click\nfrom click_default_group import DefaultGroup\n\n@click.group(cls=DefaultGroup, default='foo', default_if_no_args=True)\ndef cli():\n pass\n\n@cli.command()\ndef foo():\n click.echo('foo')\n\n@cli.command()\ndef bar():\n click.echo('bar')\n```\n\nThen you can invoke that without explicit subcommand name:\n\n```console\n$ cli.py --help\nUsage: cli.py [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n --help Show this message and exit.\n\nCommand:\n foo*\n bar\n\n$ cli.py\nfoo\n$ cli.py foo\nfoo\n$ cli.py bar\nbar\n```\n\nCompatibility\n-------------\n\n`click-default-group` is compatible with these Click versions:\n\n- Click-7.0\n- Click-6.x\n- Click-5.1\n- Click-5.0\n- Click-4.1\n- Click-4.0\n\nSee the [latest build status](https://travis-ci.org/click-contrib/click-default-group)\nat Travis CI.\n\nLicensing\n---------\n\nWritten by [Heungsub Lee], and distributed under the [BSD 3-Clause] license.\n\n[Heungsub Lee]: https://subl.ee/\n[BSD 3-Clause]: https://opensource.org/licenses/BSD-3-Clause\n\n",
"bugtrack_url": null,
"license": "",
"summary": "click_default_group",
"version": "1.2.4",
"project_urls": {
"Source": "https://github.com/click-contrib/click-default-group"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2c1aaff8bb287a4b1400f69e09a53bd65de96aa5cee5691925b38731c67fc695",
"md5": "d2884fe764749a20e2ac0509feccbe45",
"sha256": "9b60486923720e7fc61731bdb32b617039aba820e22e1c88766b1125592eaa5f"
},
"downloads": -1,
"filename": "click_default_group-1.2.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "d2884fe764749a20e2ac0509feccbe45",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=2.7",
"size": 4123,
"upload_time": "2023-08-04T07:54:56",
"upload_time_iso_8601": "2023-08-04T07:54:56.875089Z",
"url": "https://files.pythonhosted.org/packages/2c/1a/aff8bb287a4b1400f69e09a53bd65de96aa5cee5691925b38731c67fc695/click_default_group-1.2.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1dceedb087fb53de63dad3b36408ca30368f438738098e668b78c87f93cd41df",
"md5": "15fca82cd7deb30971b0ae8313fe44b2",
"sha256": "eb3f3c99ec0d456ca6cd2a7f08f7d4e91771bef51b01bdd9580cc6450fe1251e"
},
"downloads": -1,
"filename": "click_default_group-1.2.4.tar.gz",
"has_sig": false,
"md5_digest": "15fca82cd7deb30971b0ae8313fe44b2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7",
"size": 3505,
"upload_time": "2023-08-04T07:54:58",
"upload_time_iso_8601": "2023-08-04T07:54:58.425444Z",
"url": "https://files.pythonhosted.org/packages/1d/ce/edb087fb53de63dad3b36408ca30368f438738098e668b78c87f93cd41df/click_default_group-1.2.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-04 07:54:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "click-contrib",
"github_project": "click-default-group",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"lcname": "click-default-group"
}