Skip to content

Commit

Permalink
Update documentation for new qvm-ls options
Browse files Browse the repository at this point in the history
Follow-up to #301
Options are grouped as general, formatting, filtering and sorting
  • Loading branch information
alimirjamali committed Jul 26, 2024
1 parent 1d8d4bd commit bd26a0c
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 28 deletions.
123 changes: 97 additions & 26 deletions doc/manpages/qvm-ls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,27 @@ Synopsis

:command:`qvm-ls` [-h] [--verbose] [--quiet] [--help-columns] [--help-formats] [--format *FORMAT* | --fields *FIELD*,...] [--tags *TAG* [*TAG* ...]] [--running] [--paused] [--halted]

Options
-------
Positional arguments
--------------------

.. option:: VMNAME

Zero or more domain names

General options
---------------

.. option:: --help, -h

Show help message and exit

.. option:: --help-columns
.. option:: --verbose, -v

List all available columns with short descriptions and exit.
Increase verbosity.

.. option:: --help-formats
.. option:: --quiet, -q

List all available formats with their definitions and exit.
Decrease verbosity.

.. option:: --all

Expand All @@ -32,6 +39,17 @@ Options
Exclude the qube from --all. You need to use --all option explicitly to use
--exclude.

.. option:: --spinner

Have a spinner spinning while the spinning mainloop spins new table cells.

.. option:: --no-spinner

No spinner today.

Formatting options
------------------

.. option:: --format=FORMAT, -o FORMAT

Sets format to a list of columns defined by preset. All formats along with
Expand All @@ -43,14 +61,10 @@ Options
:option:`--format`. All columns along with short descriptions can be listed
with :option:`--help-columns`.

.. option:: --tags TAG ...

Shows only VMs having specific tag(s).

.. option:: --running, --paused, --halted
.. option:: --tree, -t

Shows only VMs matching the specified power state(s). When none of these
options is used (default), all VMs are shown.
List domains as a network tree. Domains are sorted as they are connected to
their netvms. Names are indented relative to the number of connected netvms.

.. option:: --raw-data

Expand All @@ -62,11 +76,6 @@ Options
Give plain list of VM names, without header or separator. Useful in scripts.
Same as --raw-data --fields=name

.. option:: --tree, -t

List domains as a network tree. Domains are sorted as they are connected to
their netvms. Names are indented relative to the number of connected netvms.

.. option:: --disk, -d

Same as --format=disk, for compatibility with Qubes 3.x
Expand All @@ -79,21 +88,83 @@ Options

Same as --format=kernel, for compatibility with Qubes 3.x

.. option:: --verbose, -v
.. option:: --help-columns

Increase verbosity.
List all available columns with short descriptions and exit.

.. option:: --quiet, -q
.. option:: --help-formats

Decrease verbosity.
List all available formats with their definitions and exit.

.. option:: --spinner
Filtering options
-----------------

Have a spinner spinning while the spinning mainloop spins new table cells.
.. option:: --class CLASS ...

.. option:: --no-spinner
Show only qubes of specific class(es)

No spinner today.
.. option:: --label LABEL ...

Show only qubes with specific label(s)

.. option:: --tags TAG ...

Shows only VMs having specific tag(s).

.. option:: --exclude-tags TAG ...

Exclude VMs having specific tag(s).

.. option:: --running, --paused, --halted

Shows only VMs matching the specified power state(s). When none of these
options is used (default), all VMs are shown.

.. option:: --template-source TEMPLATE ...

Filter results to the qubes based on the TEMPLATE(s)

.. option:: --netvm-is NETVM ...

Filter results to the qubes connecting via NETVM(s)

.. option:: --internal <y|n>

Show only internal qubes or exclude them from output

.. option:: --servicevm <y|n>

Show only servicevms or exclude them from output

.. option:: --pending-update

Filter results to qubes pending for update

.. option:: --features FEATURE=VALUE ...

Filter results to qubes that match all specified features. Omitted VALUE
means None (not set). "" or '' means blank

.. option:: --prefs PREFERENCE=VALUE ...

Filter results to qubes that match all specified preferences. Omitted VALUE
means None (not set). "" or '' means blank

Sorting options
---------------

.. option:: --sort COLUMN

Sort based on provided column rather than NAME. Sort key should be in the
output columns

.. option:: --reverse

Reverse sort

.. option:: --ignore-case

Ignore case distinctions for sorting

Authors
-------
Expand Down
4 changes: 2 additions & 2 deletions qubesadmin/tools/qvm_ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,10 +720,10 @@ def get_parser():
default='NAME', help='sort based on provided column rather than NAME')

parser_sort.add_argument('--reverse', action='store_true', default=False,
help='Reverse sort')
help='reverse sort')

parser_sort.add_argument('--ignore-case', action='store_true',
default=False, help='Ignore case distinctions for sorting')
default=False, help='ignore case distinctions for sorting')

parser.add_argument('--spinner',
action='store_true', dest='spinner',
Expand Down

0 comments on commit bd26a0c

Please sign in to comment.