Total Complexity | 3 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | """ |
||
2 | This module holds the console script argument schema for the main script of |
||
3 | {{ cookiecutter.project_slug }} which can be invoked by {{ cookiecutter.project_slug.replace('_', '-') }} |
||
4 | """ |
||
5 | import platform |
||
6 | import sys |
||
7 | import click |
||
8 | |||
9 | from .. import __version__ |
||
10 | |||
11 | |||
12 | def cli(): |
||
13 | """ |
||
14 | Main CLI interface exposed to the cli module and exposed to the console |
||
15 | script. |
||
16 | """ |
||
17 | click.echo(f"Calling {sys.argv[0]}") |
||
18 | |||
19 | |||
20 | @click.command() |
||
21 | def run(): |
||
22 | """ |
||
23 | The function that gets invoked by the subcommand "run" |
||
24 | """ |
||
25 | click.echo("Running the script") |
||
26 | |||
27 | |||
28 | @click.command() |
||
29 | def version(): |
||
30 | """ |
||
31 | The function that gets invoked by the subcommand "version" |
||
32 | """ |
||
33 | click.echo( |
||
34 | f"Python {platform.python_version()}\n" |
||
35 | f"{{ cookiecutter.project_slug }} {__version__}" |
||
36 | ) |
||
37 | |||
38 | |||
39 | cli.add_command(run) # pylint: disable=no-member |
||
40 | cli.add_command(version) # pylint: disable=no-member |
||
41 |