qvm-template: Tweak machine-readable output format.

This commit is contained in:
WillyPillow 2020-08-26 01:31:33 +08:00
parent 6efd85afba
commit 2e06e300e6
No known key found for this signature in database
GPG Key ID: 3839E194B1415A9C
2 changed files with 3 additions and 4 deletions

View File

@ -219,7 +219,7 @@ Options
::
|{status}|{name}|{evr}|{reponame}|
{status}|{name}|{evr}|{reponame}
Where ``{status}`` can be one of ``installed``, ``available``,
``extra``, or ``upgradable``.
@ -307,7 +307,7 @@ Options
::
|{status}|{name}|{epoch}|{version}|{release}|{reponame}|{size}|{buildtime}|{installtime}|{license}|{url}|{summary}|{description}|
{status}|{name}|{epoch}|{version}|{release}|{reponame}|{size}|{buildtime}|{installtime}|{license}|{url}|{summary}|{description}
Where ``{status}`` can be one of ``installed``, ``available``,
``extra``, or ``upgradable``.

View File

@ -1082,9 +1082,8 @@ def list_templates(args: argparse.Namespace,
elif operation == 'list':
tpl_list = list_to_machine_output(tpl_list)
for status, grp in tpl_list.items():
print('|' + status)
for line in grp:
print('|'.join(line.values()) + '|')
print('|'.join([status] + list(line.values())))
elif args.machine_readable_json:
if operation == 'info':
tpl_list = info_to_machine_output(tpl_list, replace_newline=False)