Implement qvm-ls --list-fields

This commit is contained in:
Jean-Philippe Ouellet 2016-11-27 01:12:53 -05:00
parent 02d8f273f2
commit 6ddf141376
No known key found for this signature in database
GPG Key ID: E7E455013D042EA1
2 changed files with 10 additions and 0 deletions

View File

@ -34,6 +34,8 @@ OPTIONS
List only VM names one per line
--raw-data
Display specify data of specified VMs. Intended for bash-parsing.
--list-fields
List field names valid for --raw-data
AUTHORS
=======

View File

@ -134,9 +134,17 @@ def main():
help="Display specify data of specified VMs.\
Intended for bash-parsing.")
parser.add_argument("--list-fields", dest="list_fields",
action="store_true", default=False,
help="List field names valid for --raw-data")
arguments = parser.parse_args ()
if arguments.list_fields:
print '\n'.join(sorted(fields.keys()))
return
qvm_collection = QubesVmCollection()
qvm_collection.lock_db_for_reading()
qvm_collection.load()