main: add -w to *enforce* wrapping
This commit is contained in:
parent
57d5ed474f
commit
4c77a16bba
2 changed files with 13 additions and 9 deletions
12
main.py
12
main.py
|
@ -1,11 +1,13 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import click
|
import click
|
||||||
from traceback import format_exc as get_trace
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
from traceback import format_exc as get_trace
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
from logger import logging, setup_logging, verbose_option
|
from logger import logging, setup_logging, verbose_option
|
||||||
from wrapper import nowrapper_option
|
from wrapper import nowrapper_option, enforce_wrap
|
||||||
from config import config, config_option, cmd_config
|
from config import config, config_option, cmd_config
|
||||||
from forwarding import cmd_forwarding
|
from forwarding import cmd_forwarding
|
||||||
from packages import cmd_packages
|
from packages import cmd_packages
|
||||||
|
@ -23,12 +25,14 @@ from ssh import cmd_ssh
|
||||||
@verbose_option
|
@verbose_option
|
||||||
@config_option
|
@config_option
|
||||||
@nowrapper_option
|
@nowrapper_option
|
||||||
def cli(verbose: bool = False, config_file: str = None, no_wrapper: bool = False, error_shell: bool = False):
|
def cli(verbose: bool = False, config_file: str = None, wrapper_override: Optional[bool] = None, error_shell: bool = False):
|
||||||
setup_logging(verbose)
|
setup_logging(verbose)
|
||||||
config.runtime['verbose'] = verbose
|
config.runtime['verbose'] = verbose
|
||||||
config.runtime['no_wrap'] = no_wrapper
|
config.runtime['no_wrap'] = wrapper_override is False
|
||||||
config.runtime['error_shell'] = error_shell
|
config.runtime['error_shell'] = error_shell
|
||||||
config.try_load_file(config_file)
|
config.try_load_file(config_file)
|
||||||
|
if wrapper_override:
|
||||||
|
enforce_wrap()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -51,10 +51,10 @@ def wrap_if_foreign_arch(arch: Arch):
|
||||||
|
|
||||||
|
|
||||||
nowrapper_option = click.option(
|
nowrapper_option = click.option(
|
||||||
'-W',
|
'-w/-W',
|
||||||
'--no-wrapper',
|
'--force-wrapper/--no-wrapper',
|
||||||
'no_wrapper',
|
'wrapper_override',
|
||||||
is_flag=True,
|
is_flag=True,
|
||||||
default=False,
|
default=None,
|
||||||
help='Disable the docker wrapper. Defaults to autodetection.',
|
help='Force or disable the docker wrapper. Defaults to autodetection.',
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue