From f3591faf957503d3911b3d06b737321c55cf2a8c Mon Sep 17 00:00:00 2001 From: "Robin C. Ladiges" Date: Wed, 4 Nov 2020 02:43:19 +0100 Subject: [PATCH] aliases: --/ls/list/show For `pass` it depends on the entry whether it outputs the password (`get`) or shows the (sub-)directory tree (`list`). It seems to behave identical for all commands: '', '--', 'ls', 'list', 'show'. This commit should fix issue #3 --- bin/qvm-pass | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/qvm-pass b/bin/qvm-pass index bab64e4..d89a875 100755 --- a/bin/qvm-pass +++ b/bin/qvm-pass @@ -189,9 +189,10 @@ if not any(x in sys.argv[1:] for x in ['--help', '-h', '-?']): " your pass setup, set the environment variable yourself," " or pass -d on the command line.",) - if len(args) == 0 or (len(args) == 1 and args[0] == "--"): + show = len(args) > 0 and (args[0] == "--" or args[0] == "ls" or args[0] == "list" or args[0] == "show") + if len(args) == 0 or (len(args) == 1 and show): sys.exit(pass_read("list")) - elif len(args) == 1 or (len(args) == 2 and args[0] == "--"): + elif len(args) == 1 or (len(args) == 2 and show): sys.exit(pass_read("get", args[-1])) opts = parser_for_subcommands.parse_args()