fix: Restore verbose option to list command

Commit 378d95e ("Add option to only list running VMs") removed the call
to cmd::parse_args which supported the -v ("verbose") option. Add back
the ability to pass the -v option directly instead of using the utility
function itself.

While here, also update the man page to document the verbose option.

Reported-by: drTr0jan
This commit is contained in:
Chuck Tuffli
2025-01-16 08:54:04 -08:00
parent dc92eeaae9
commit 85d916fd00
2 changed files with 8 additions and 8 deletions

View File

@@ -34,16 +34,14 @@ core::list(){
local _state _pcpu _rss _uptime local _state _pcpu _rss _uptime
local _format="%s^%s^%s^%s^%s^%s^%s^%s\n" local _format="%s^%s^%s^%s^%s^%s^%s^%s\n"
while getopts r _opt ; do while getopts rv _opt ; do
case $_opt in case ${_opt} in
r) _running_only='true' ;; r) _running_only='true' ;;
v) VM_OPT_VERBOSE="1" ;;
*) util::usage ;; *) util::usage ;;
esac esac
done done
shift $?
_our_host=$(hostname) _our_host=$(hostname)
vm::running_load vm::running_load

8
vm.8
View File

@@ -83,7 +83,7 @@
.Ar name .Ar name
.Nm .Nm
.Cm list .Cm list
.Op Fl r .Op Fl rv
.Nm .Nm
.Cm info .Cm info
.Op Ar name .Op Ar name
@@ -650,14 +650,16 @@ Removes the specified virtual machine from the system, deleting all associated
disk images & configuration. disk images & configuration.
.It Xo .It Xo
.Cm list .Cm list
.Op Fl r .Op Fl rv
.Xc .Xc
.br .br
List all the virtual machines in the List all the virtual machines in the
.Pa $vm_dir .Pa $vm_dir
directory. directory.
This will show the basic configuration for each virtual machine, and whether This will show the basic configuration for each virtual machine, and whether
they are currently running. they are currently running. Using the
.Ar -v
option displays additional information about each virtual machine.
.Pp .Pp
If the If the
.Ar -r .Ar -r