mirror of
https://git.isptech.ru/ISPsystem/isp-maintenance.git
synced 2025-09-13 20:03:08 +02:00
Add: core cli, lazy_group, example apps
This commit is contained in:
12
isp_maintenance/apps/dci6/access/commands.py
Normal file
12
isp_maintenance/apps/dci6/access/commands.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import click
|
||||
|
||||
|
||||
@click.group(help='access command for lazy example')
|
||||
@click.option('--debug/--no-debug', default=False)
|
||||
def cli(debug):
|
||||
click.echo(f"Debug mode is {'on' if debug else 'off'}")
|
||||
|
||||
|
||||
@cli.command()
|
||||
def enable():
|
||||
click.echo('Access granted')
|
13
isp_maintenance/apps/dci6/commands.py
Normal file
13
isp_maintenance/apps/dci6/commands.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import click
|
||||
|
||||
from core.cli.lazy_group import LazyGroup
|
||||
from settings.general import INSTALLED_APPS
|
||||
|
||||
|
||||
@click.group(
|
||||
cls=LazyGroup,
|
||||
lazy_subcommands=INSTALLED_APPS['dci6'],
|
||||
help='dci6 command for lazy example',
|
||||
)
|
||||
def cli():
|
||||
pass
|
Reference in New Issue
Block a user