Show usage message of xm sysrq
PATCH 1/1 Show usage message of xm sysrq
Hi,
Even if the "xm sysrq" command specified invalid arguments as below, the command error did not occur.
# xm sysrq vm1 m xyz #
If invalid arguments are specified, this patch shows an usage message.
# xm sysrq vm1 m xyz Usage: sysrq [DOM] [letter]
Sends a Linux sysrq to a domain.
-h, --help
Print this help.
Best regards,
Kan
tools/python/xen/xm/sysrq.py +3 -2
@@ -24,8 +24,9 @@ def main(argv): return # no options for the moment - if len(args) < 1: opts.err('Missing domain') - if len(args) < 2: opts.err('Missing sysrq character') + if len(args) != 2: + opts.usage() + sys.exit(1) dom = args[0] req = ord(args[1][0]) server.xend.domain.send_sysrq(dom, req)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Ewan Mellor
AppliedOn Mon, Sep 11, 2006 at 06:40:01PM +0900, Masaki Kanno wrote:
Content-Description: Mail message body
Quoted 15 lines
Hi,
Even if the "xm sysrq" command specified invalid arguments as below, the command error did not occur.
# xm sysrq vm1 m xyz #If invalid arguments are specified, this patch shows an usage message.
# xm sysrq vm1 m xyz Usage: sysrq [DOM] [letter]
Quoted 8 lines
Sends a Linux sysrq to a domain.
-h, --help
Print this help.Signed-off-by Masaki Kanno <[email protected]>
Applied, thank you.
Ewan.