7
7
[ ![ License] ( https://img.shields.io/badge/License-BSD%203--Clause-blue.svg )] ( https://opensource.org/licenses/BSD-3-Clause )
8
8
9
9
10
- ** click-option-group** is a Click-extension package that adds option groups
10
+ ** click-option-group** is a Click-extension package that adds option groups
11
11
missing in [ Click] ( https://github.com/pallets/click/ ) .
12
12
13
13
## Aim and Motivation
14
14
15
- Click is a package for creating powerful and beautiful command line interfaces (CLI) in Python,
15
+ Click is a package for creating powerful and beautiful command line interfaces (CLI) in Python,
16
16
but it has no the functionality for creating option groups.
17
17
18
- Option groups are convenient mechanism for logical structuring CLI, also it allows you to set
19
- the specific behavior and set the relationship among grouped options (mutually exclusive options for example).
20
- Moreover, [ argparse] ( https://docs.python.org/3/library/argparse.html ) stdlib package contains this
18
+ Option groups are convenient mechanism for logical structuring CLI, also it allows you to set
19
+ the specific behavior and set the relationship among grouped options (mutually exclusive options for example).
20
+ Moreover, [ argparse] ( https://docs.python.org/3/library/argparse.html ) stdlib package contains this
21
21
functionality out of the box.
22
22
23
23
At the same time, many Click users need this functionality.
@@ -28,12 +28,12 @@ You can read interesting discussions about it in the following issues:
28
28
* [ issue 509] ( https://github.com/pallets/click/issues/509 )
29
29
* [ issue 1137] ( https://github.com/pallets/click/issues/1137 )
30
30
31
- The aim of this package is to provide group options with extensible functionality
31
+ The aim of this package is to provide group options with extensible functionality
32
32
using canonical and clean API (Click-like API as far as possible).
33
33
34
34
## Quickstart
35
35
36
- ### Installing
36
+ ### Installing
37
37
38
38
Install and update using pip:
39
39
@@ -44,7 +44,7 @@ pip install -U click-option-group
44
44
### A Simple Example
45
45
46
46
Here is a simple example how to use option groups in your Click-based CLI.
47
- Just use ` optgroup ` for declaring option groups by decorating
47
+ Just use ` optgroup ` for declaring option groups by decorating
48
48
your command function in Click-like API style.
49
49
50
50
``` python
@@ -54,13 +54,13 @@ import click
54
54
from click_option_group import optgroup, RequiredMutuallyExclusiveOptionGroup
55
55
56
56
@click.command ()
57
- @optgroup.group (' Server configuration' ,
57
+ @optgroup.group (' Server configuration' ,
58
58
help = ' The configuration of some server connection' )
59
59
@optgroup.option (' -h' , ' --host' , default = ' localhost' , help = ' Server host name' )
60
60
@optgroup.option (' -p' , ' --port' , type = int , default = 8888 , help = ' Server port' )
61
61
@optgroup.option (' -n' , ' --attempts' , type = int , default = 3 , help = ' The number of connection attempts' )
62
62
@optgroup.option (' -t' , ' --timeout' , type = int , default = 30 , help = ' The server response timeout' )
63
- @optgroup.group (' Input data sources' , cls = RequiredMutuallyExclusiveOptionGroup,
63
+ @optgroup.group (' Input data sources' , cls = RequiredMutuallyExclusiveOptionGroup,
64
64
help = ' The sources of the input data' )
65
65
@optgroup.option (' --tsv-file' , type = click.File(), help = ' CSV/TSV input data file' )
66
66
@optgroup.option (' --json-file' , type = click.File(), help = ' JSON input data file' )
0 commit comments