From a6e5e1450b5af05de6c0255d0bf8da8f467fdef3 Mon Sep 17 00:00:00 2001 From: "Manuel Amador (Rudd-O)" Date: Thu, 18 Aug 2022 09:45:11 +0000 Subject: [PATCH] Some reformatting of code. --- bin/qvm-pass | 82 ++++++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/bin/qvm-pass b/bin/qvm-pass index 33bbac7..c33a653 100755 --- a/bin/qvm-pass +++ b/bin/qvm-pass @@ -17,43 +17,46 @@ except ImportError: signal.signal(signal.SIGINT, signal.SIG_DFL) -usage = "\n".join( - [ - "qvm-pass usage:", - "", - " qvm-pass [-d ] [subcommand] [arguments...]", - "", - "subcommands (try qvm-pass subcommand --help for more):", - "", - " [ls|list|show]", - " Retrieves the list of keys from the pass store.", - " [show] [-c] ", - " Retrieves a key from the pass store.", - " generate [-n] [-f] [pass-length]", - " Retrieves a key from the pass store; creates the key", - " with 25 characters length if it does not exist yet,", - " and returns the generated key on standard output.", - " The -n option excludes symbols from being used", - " during password generation.", - " get-or-generate [-n] [pass-length]", - " Retrieves a key from the pass store; creates the key", - " with 25 characters length if it does not exist yet,", - " and returns the generated key on standard output.", - " The -n option excludes symbols from being used", - " during password generation.", - " insert [--echo,-e | --multiline,-m] [--force,-f] ", - " Creates a key in the pass store.", - " rm ", - " Removes a key from the pass store.", - " cp [-f] ", - " Copies a key to another key in the pass store,", - " optionally forcefully.", - " mv [-f] ", - " Moves a key to another key in the pass store,", - " optionally forcefully.", - " init [GPG IDs...]", - " Initializes the pass store.", - ] +usage_string = ( + "\n".join( + [ + "qvm-pass usage:", + "", + " qvm-pass [-d ] [subcommand] [arguments...]", + "", + "subcommands (try qvm-pass subcommand --help for more):", + "", + " [ls|list|show]", + " Retrieves the list of keys from the pass store.", + " [show] [-c] ", + " Retrieves a key from the pass store.", + " generate [-n] [-f] [pass-length]", + " Retrieves a key from the pass store; creates the key", + " with 25 characters length if it does not exist yet,", + " and returns the generated key on standard output.", + " The -n option excludes symbols from being used", + " during password generation.", + " get-or-generate [-n] [pass-length]", + " Retrieves a key from the pass store; creates the key", + " with 25 characters length if it does not exist yet,", + " and returns the generated key on standard output.", + " The -n option excludes symbols from being used", + " during password generation.", + " insert [--echo,-e | --multiline,-m] [--force,-f] ", + " Creates a key in the pass store.", + " rm ", + " Removes a key from the pass store.", + " cp [-f] ", + " Copies a key to another key in the pass store,", + " optionally forcefully.", + " mv [-f] ", + " Moves a key to another key in the pass store,", + " optionally forcefully.", + " init [GPG IDs...]", + " Initializes the pass store.", + ] + ) + + "\n" ) @@ -153,7 +156,7 @@ parser_for_discrimination.add_argument( parser_for_subcommands = argparse.ArgumentParser( description="A Qubes-RPC inter-vm client for the pass password manager.", - usage=usage, + usage=usage_string, ) parser_for_subcommands.add_argument( "-d", @@ -327,6 +330,9 @@ def pass_manage(*args, **kwargs): return send_args(PASS_MANAGE, *args, **kwargs) +# -------------------- Begin ---------------------- + + arguments = sys.argv[1:] if "--help" in arguments or "-h" in arguments or "-?" in arguments: parser_for_subcommands.parse_known_args(arguments)