Skip to contentSkip to conversation

xm: Show usage message of xm commands

PATCH New Masaki Kanno 1 participant 1 message Feb 24, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xm: Show usage message of xm commands

Hi,

The following commands don't show an usage message even if we give a wrong option to the commands.

- xm block-list
- xm network-list
- xm network2-list
- xm vtpm-list
- xm pci-list
- xm scsi-list

e.g.

 # xm block-list --xxx vm1
 Error: option --xxx not recognized

This patch shows the usage message of the commands.

e.g.

 # xm block-list --xxx vm1
 Error: option --xxx not recognized
 Usage: xm block-list <Domain> [--long]

List virtual block devices for a domain.

Best regards,
Kan

tools/python/xen/xm/main.py +1 -1
diff -r 4ba4323889b9 tools/python/xen/xm/main.py
@@ -2122,7 +2122,7 @@
         (options, params) = getopt.gnu_getopt(args, 'l', ['long'])
     except getopt.GetoptError, opterr:
         err(opterr)
-        sys.exit(1)
+        usage(name)
 
     for (k, v) in options:
         if k in ['-l', '--long']:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel