CmdGetAuthInfo: Fix: Suppress user name "None"

Don't print username="None" if there's no such user

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-11-19 20:00:13 +01:00
commit e95f91aff8

View file

@ -36,7 +36,10 @@ class CmdGetAuthInfo(Cmd): # export
result[key] = getattr(parsed, key)
break
for key in keys:
if key in result and getattr(args, key, None):
if not args.only_values:
print(f'{key}=', end='')
print(result[key])
if key in result and getattr(args, key, None) == True:
if key is None:
continue
if args.only_values:
print(result[key])
continue
print(f'{key}="{result[key]}"')