Completed
Push — master ( 4d566a...ef5f77 )
by Komail
18s queued 10s
created

{{cookiecutter.project_slug}}.cli.main.run()   A

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nop 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(f"Python {platform.python_version()}\n"
34
               f"{{ cookiecutter.project_slug }} {__version__}")
35
36
37
cli.add_command(run)  # pylint: disable=no-member
38
cli.add_command(version)  # pylint: disable=no-member
39