adding initial boilerplates
This commit is contained in:
15
python/cli-click/multipleSubCommands-use.py
Normal file
15
python/cli-click/multipleSubCommands-use.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import click
|
||||
from complex.cli import pass_environment
|
||||
|
||||
|
||||
@click.command('init', short_help='Initializes a repo.')
|
||||
@click.argument('path', required=False, type=click.Path(resolve_path=True))
|
||||
@pass_environment
|
||||
def cli(ctx, path):
|
||||
"""Initializes a repository."""
|
||||
print(f'{ctx=}')
|
||||
print(f'{dir(ctx)=}')
|
||||
if path is None:
|
||||
path = ctx.home
|
||||
ctx.log('Initialized the repository in %s',
|
||||
click.format_filename(path))
|
||||
Reference in New Issue
Block a user