mypass: Add functionality to get multiple values
This commit is contained in:
@@ -43,7 +43,7 @@ def cmd_get(*args):
|
||||
print(get_stdout(['pass', 'show', args[0]]).split(b'\n')[0].decode())
|
||||
return 0
|
||||
|
||||
if len(args) != 2:
|
||||
if len(args) < 2:
|
||||
print("what do you want to get?")
|
||||
return 1
|
||||
|
||||
@@ -62,7 +62,8 @@ def cmd_get(*args):
|
||||
print("invalid YAML data, not a dict")
|
||||
return 2
|
||||
|
||||
keydata = extract_from_dict(data, args[1])
|
||||
for element in args[1:]:
|
||||
keydata = extract_from_dict(data, element)
|
||||
if isinstance(keydata, list) or isinstance(keydata, dict):
|
||||
print(yaml.safe_dump(keydata, default_flow_style=False).strip())
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user