File: cli.py

package info (click to toggle)
sphinx-click 6.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 352 kB
  • sloc: python: 1,038; makefile: 10
file content (33 lines) | stat: -rw-r--r-- 710 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# file: cli.py
import click


@click.command()
@click.option('--param', envvar='PARAM', help='A sample option')
@click.option('--another', metavar='[FOO]', help='Another option')
@click.option(
    '--choice',
    help='A sample option with choices',
    type=click.Choice(['Option1', 'Option2']),
)
@click.option(
    '--numeric-choice',
    metavar='<choice>',
    help='A sample option with numeric choices',
    type=click.Choice([1, 2, 3]),
)
@click.option(
    '--flag',
    is_flag=True,
    help='A boolean flag',
)
@click.argument('ARG', envvar='ARG')
def cli(
    param: str,
    another: str,
    choice: str,
    numeric_choice: int,
    flag: bool,
) -> None:
    """A sample command."""
    pass