mirror of
https://github.com/chatmail/relay.git
synced 2026-05-15 10:24:40 +00:00
move --verbose option back to subcommands
This commit is contained in:
@@ -371,6 +371,14 @@ def add_subcommand(subparsers, func, add_config=True):
|
|||||||
p.set_defaults(func=func)
|
p.set_defaults(func=func)
|
||||||
if add_config:
|
if add_config:
|
||||||
add_config_option(p)
|
add_config_option(p)
|
||||||
|
p.add_argument(
|
||||||
|
"-v",
|
||||||
|
"--verbose",
|
||||||
|
dest="verbose",
|
||||||
|
action="count",
|
||||||
|
default=0,
|
||||||
|
help="increase verbosity (can be repeated: -v, -vv)",
|
||||||
|
)
|
||||||
return p
|
return p
|
||||||
|
|
||||||
|
|
||||||
@@ -402,14 +410,6 @@ def get_parser():
|
|||||||
|
|
||||||
parser = argparse.ArgumentParser(description=description.strip())
|
parser = argparse.ArgumentParser(description=description.strip())
|
||||||
parser.set_defaults(func=None, inipath=None)
|
parser.set_defaults(func=None, inipath=None)
|
||||||
parser.add_argument(
|
|
||||||
"-v",
|
|
||||||
"--verbose",
|
|
||||||
dest="verbose",
|
|
||||||
action="count",
|
|
||||||
default=0,
|
|
||||||
help="increase verbosity (can be repeated: -v, -vv)",
|
|
||||||
)
|
|
||||||
subparsers = parser.add_subparsers(title="subcommands")
|
subparsers = parser.add_subparsers(title="subcommands")
|
||||||
|
|
||||||
for func, addopts, needs_config in SUBCOMMANDS:
|
for func, addopts, needs_config in SUBCOMMANDS:
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ def lxc_test_cmd(args, out):
|
|||||||
name = ct.sname
|
name = ct.sname
|
||||||
ipv4_only = ipv4_only_flags.get(name, False)
|
ipv4_only = ipv4_only_flags.get(name, False)
|
||||||
v_flag = " -" + "v" * out.verbosity if out.verbosity > 0 else ""
|
v_flag = " -" + "v" * out.verbosity if out.verbosity > 0 else ""
|
||||||
start_cmd = f"cmdeploy{v_flag} lxc-start {name}"
|
start_cmd = f"cmdeploy lxc-start{v_flag} {name}"
|
||||||
if ipv4_only:
|
if ipv4_only:
|
||||||
start_cmd += " --ipv4-only"
|
start_cmd += " --ipv4-only"
|
||||||
with out.section(f"cmdeploy lxc-start: {name}"):
|
with out.section(f"cmdeploy lxc-start: {name}"):
|
||||||
@@ -443,7 +443,7 @@ def _run_cmdeploy(subcmd, ct, ix, out, extra=None, **kwargs):
|
|||||||
extra_str = " ".join(extra) if extra else ""
|
extra_str = " ".join(extra) if extra else ""
|
||||||
v_flag = " -" + "v" * out.verbosity if out.verbosity > 0 else ""
|
v_flag = " -" + "v" * out.verbosity if out.verbosity > 0 else ""
|
||||||
cmd = f"""\
|
cmd = f"""\
|
||||||
cmdeploy{v_flag} {subcmd}
|
cmdeploy {subcmd}{v_flag}
|
||||||
--config {ct.ini}
|
--config {ct.ini}
|
||||||
--ssh-config {ix.ssh_config_path}
|
--ssh-config {ix.ssh_config_path}
|
||||||
--ssh-host {ct.domain}
|
--ssh-host {ct.domain}
|
||||||
|
|||||||
Reference in New Issue
Block a user