Exemplo n.º 1
0
def host_cmd(lib, argv, modifiers):
    if len(argv) < 1:
        utils.exit_on_cmdline_input_errror(None, "host", "")
    else:
        sub_cmd, argv_next = argv[0], argv[1:]

    try:
        if sub_cmd == "help":
            usage.host([" ".join(argv_next)] if argv_next else [])
        elif sub_cmd == "auth":
            auth_cmd(lib, argv_next, modifiers)
        elif sub_cmd == "deauth":
            deauth_cmd(lib, argv_next, modifiers)
        else:
            raise CmdLineInputError()
    except LibraryError as e:
        utils.process_library_reports(e.args)
    except CmdLineInputError as e:
        utils.exit_on_cmdline_input_errror(e, "host", sub_cmd)
Exemplo n.º 2
0
from pcs import (
    host,
    usage,
)
from pcs.cli.common.routing import create_router


host_cmd = create_router(
    {
        "help": lambda lib, argv, modifiers: usage.host(argv),
        "auth": host.auth_cmd,
        "deauth": host.deauth_cmd,
    },
    ["host"]
)
Exemplo n.º 3
0
from pcs import (
    host,
    usage,
)
from pcs.cli.common.routing import create_router

host_cmd = create_router(
    {
        "help": lambda lib, argv, modifiers: usage.host(argv),
        "auth": host.auth_cmd,
        "deauth": host.deauth_cmd,
    },
    ["host"],
)
Exemplo n.º 4
0
Arquivo: host.py Projeto: kmalyjur/pcs
from pcs import (
    host,
    usage,
)
from pcs.cli.common.routing import create_router

host_cmd = create_router(
    {
        "help": lambda lib, argv, modifiers: print(usage.host(argv)),
        "auth": host.auth_cmd,
        "deauth": host.deauth_cmd,
    },
    ["host"],
)