Some reformatting of code.

This commit is contained in:
Manuel Amador (Rudd-O) 2022-08-18 09:45:11 +00:00
parent 2e179e5737
commit a6e5e1450b

View File

@ -17,43 +17,46 @@ except ImportError:
signal.signal(signal.SIGINT, signal.SIG_DFL) signal.signal(signal.SIGINT, signal.SIG_DFL)
usage = "\n".join( usage_string = (
[ "\n".join(
"qvm-pass usage:", [
"", "qvm-pass usage:",
" qvm-pass [-d <passvm>] [subcommand] [arguments...]", "",
"", " qvm-pass [-d <passvm>] [subcommand] [arguments...]",
"subcommands (try qvm-pass subcommand --help for more):", "",
"", "subcommands (try qvm-pass subcommand --help for more):",
" [ls|list|show]", "",
" Retrieves the list of keys from the pass store.", " [ls|list|show]",
" [show] [-c] <key>", " Retrieves the list of keys from the pass store.",
" Retrieves a key from the pass store.", " [show] [-c] <key>",
" generate [-n] [-f] <key> [pass-length]", " Retrieves a key from the pass store.",
" Retrieves a key from the pass store; creates the key", " generate [-n] [-f] <key> [pass-length]",
" with 25 characters length if it does not exist yet,", " Retrieves a key from the pass store; creates the key",
" and returns the generated key on standard output.", " with 25 characters length if it does not exist yet,",
" The -n option excludes symbols from being used", " and returns the generated key on standard output.",
" during password generation.", " The -n option excludes symbols from being used",
" get-or-generate [-n] <key> [pass-length]", " during password generation.",
" Retrieves a key from the pass store; creates the key", " get-or-generate [-n] <key> [pass-length]",
" with 25 characters length if it does not exist yet,", " Retrieves a key from the pass store; creates the key",
" and returns the generated key on standard output.", " with 25 characters length if it does not exist yet,",
" The -n option excludes symbols from being used", " and returns the generated key on standard output.",
" during password generation.", " The -n option excludes symbols from being used",
" insert [--echo,-e | --multiline,-m] [--force,-f] <key>", " during password generation.",
" Creates a key in the pass store.", " insert [--echo,-e | --multiline,-m] [--force,-f] <key>",
" rm <key>", " Creates a key in the pass store.",
" Removes a key from the pass store.", " rm <key>",
" cp [-f] <key> <newkey>", " Removes a key from the pass store.",
" Copies a key to another key in the pass store,", " cp [-f] <key> <newkey>",
" optionally forcefully.", " Copies a key to another key in the pass store,",
" mv [-f] <key> <newkey>", " optionally forcefully.",
" Moves a key to another key in the pass store,", " mv [-f] <key> <newkey>",
" optionally forcefully.", " Moves a key to another key in the pass store,",
" init <GPD ID> [GPG IDs...]", " optionally forcefully.",
" Initializes the pass store.", " init <GPD ID> [GPG IDs...]",
] " Initializes the pass store.",
]
)
+ "\n"
) )
@ -153,7 +156,7 @@ parser_for_discrimination.add_argument(
parser_for_subcommands = argparse.ArgumentParser( parser_for_subcommands = argparse.ArgumentParser(
description="A Qubes-RPC inter-vm client for the pass password manager.", description="A Qubes-RPC inter-vm client for the pass password manager.",
usage=usage, usage=usage_string,
) )
parser_for_subcommands.add_argument( parser_for_subcommands.add_argument(
"-d", "-d",
@ -327,6 +330,9 @@ def pass_manage(*args, **kwargs):
return send_args(PASS_MANAGE, *args, **kwargs) return send_args(PASS_MANAGE, *args, **kwargs)
# -------------------- Begin ----------------------
arguments = sys.argv[1:] arguments = sys.argv[1:]
if "--help" in arguments or "-h" in arguments or "-?" in arguments: if "--help" in arguments or "-h" in arguments or "-?" in arguments:
parser_for_subcommands.parse_known_args(arguments) parser_for_subcommands.parse_known_args(arguments)