WIP: Improve config parsing, make --verbose and --config-file global options

Bonus: Generalize and reuse cmd_ssh()

Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
This commit is contained in:
InsanePrawn 2021-09-09 20:23:23 +02:00
parent 4cf608eeb6
commit 144acee10f
12 changed files with 122 additions and 104 deletions

View file

@ -1,5 +1,4 @@
from constants import REPOSITORIES
from logger import setup_logging, verbose_option
import atexit
import click
import logging
@ -463,11 +462,8 @@ def cmd_packages():
@click.command(name='build')
@verbose_option
@click.argument('paths', nargs=-1)
def cmd_build(verbose, paths):
setup_logging(verbose)
def cmd_build(paths):
check_prebuilts()
paths = list(paths)
@ -492,9 +488,7 @@ def cmd_build(verbose, paths):
@click.command(name='clean')
@verbose_option
def cmd_clean(verbose):
setup_logging(verbose)
def cmd_clean():
result = subprocess.run([
'git',
'clean',
@ -506,11 +500,8 @@ def cmd_clean(verbose):
@click.command(name='check')
@verbose_option
@click.argument('paths', nargs=-1)
def cmd_check(verbose, paths):
setup_logging(verbose)
def cmd_check(paths):
paths = list(paths)
packages = discover_packages(paths)