On Thu, Jan 16, 2014 at 03:04:31PM +0100, Pino Toscano wrote:
Add a --list-format which allows to choose which in format should be the output of --list. --- builder/cmdline.ml | 11 ++++++++++- builder/virt-builder.pod | 24 +++++++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/builder/cmdline.ml b/builder/cmdline.ml index f199f03..6d6439f 100644 --- a/builder/cmdline.ml +++ b/builder/cmdline.ml @@ -132,6 +132,13 @@ let parse_cmdline () =
let list_format = ref `Short in let list_set_long () = list_format := `Long in + let list_set_format arg = + list_format := match arg with + | "short" -> `Short + | "long" -> `Long + | fmt -> + eprintf (f_"%s: invalid --list-format type '%s', see the man page.\n") prog fmt; + exit 1 in
It's possible to write this as: let list_set_format = function | "short" -> list_format := `Short etc. Not sure if it will make any difference here. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top