Merge remote-tracking branch 'qubesos/pr/79'

* qubesos/pr/79:
  Implement qvm-ls --list-fields
This commit is contained in:
Marek Marczykowski-Górecki 2016-11-28 12:57:18 +01:00
commit 076ef884f3
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
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()