packages/flavours: rename cmd_flavours_list() to cmd_flavours(), add to main cli directly

This commit is contained in:
InsanePrawn 2022-10-08 02:20:16 +02:00
parent 6581e34087
commit 0e86de1f44
4 changed files with 4 additions and 9 deletions

View file

@ -12,6 +12,7 @@ from config import config, config_option, cmd_config
from forwarding import cmd_forwarding from forwarding import cmd_forwarding
from packages.cli import cmd_packages from packages.cli import cmd_packages
from devices.cli import cmd_devices from devices.cli import cmd_devices
from packages.flavour import cmd_flavours
from telnet import cmd_telnet from telnet import cmd_telnet
from chroot import cmd_chroot from chroot import cmd_chroot
from cache import cmd_cache from cache import cmd_cache
@ -66,6 +67,7 @@ cli.add_command(cmd_chroot)
cli.add_command(cmd_config) cli.add_command(cmd_config)
cli.add_command(cmd_devices) cli.add_command(cmd_devices)
cli.add_command(cmd_flash) cli.add_command(cmd_flash)
cli.add_command(cmd_flavours)
cli.add_command(cmd_forwarding) cli.add_command(cmd_forwarding)
cli.add_command(cmd_image) cli.add_command(cmd_image)
cli.add_command(cmd_packages) cli.add_command(cmd_packages)

View file

@ -1,3 +0,0 @@
from packages.cli import cmd_packages
assert cmd_packages # stop unused warnings; needs to be imported for click docs to be generated

View file

@ -17,7 +17,6 @@ from wrapper import check_programs_wrap, enforce_wrap
from .build import build_packages_by_paths from .build import build_packages_by_paths
from .pkgbuild import discover_pkgbuilds, filter_pkgbuilds, init_pkgbuilds from .pkgbuild import discover_pkgbuilds, filter_pkgbuilds, init_pkgbuilds
from .flavour import cmd_flavours_list
def build( def build(
@ -51,9 +50,6 @@ def cmd_packages():
"""Build and manage packages and PKGBUILDs""" """Build and manage packages and PKGBUILDs"""
cmd_packages.add_command(cmd_flavours_list, 'flavours')
@cmd_packages.command(name='update') @cmd_packages.command(name='update')
@click.option('--non-interactive', is_flag=True) @click.option('--non-interactive', is_flag=True)
@click.option('--switch-branch', is_flag=True, help="Force the branch to be corrected even in non-interactive mode") @click.option('--switch-branch', is_flag=True, help="Force the branch to be corrected even in non-interactive mode")

View file

@ -114,8 +114,8 @@ def get_profile_flavour(profile_name: Optional[str] = None) -> Flavour:
return get_flavour(profile.flavour) return get_flavour(profile.flavour)
@click.command(name='list') @click.command(name='flavours')
def cmd_flavours_list(): def cmd_flavours():
'list information about available flavours' 'list information about available flavours'
flavours = get_flavours() flavours = get_flavours()
if not flavours: if not flavours: