source: trunk/packages/sipb-xen-remote-server/files/usr/sbin/sipb-xen-remctl-help @ 817

Last change on this file since 817 was 663, checked in by price, 16 years ago

document listhost in help

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/usr/bin/python
2"""
3Help on using the Invirt remctl functions.
4"""
5import sys
6
7
8help = [
9    ('list',      'show your VM\'s state (with xm list)'),
10    ('listhost',  'show on what host, if any, your VM is running'),
11    ('list-long', 'show your VM\'s state as an sexp (with xm list --long)'),
12    ('vcpu-list', 'show your VM\'s state (with xm vcpu-list)'),
13    ('uptime',    'show your VM\'s state (with xm uptime)'),
14    ('destroy',   'shut down your VM, hard (with xm destroy)'),
15    ('shutdown',  'shut down your VM, softly if paravm (with xm shutdown)'),
16    ('create',    'start up your VM (with xm create)'),
17    ('reboot',    'reboot your VM (with xm destroy and xm create)'),
18    #also install
19    #also CD images on create/reboot
20]
21helpdict = dict(help)
22
23
24def print_help(name, text):
25    print %-9s : %s' % (name, text)
26
27def main(args):
28    args = [n for n in args if n in helpdict]
29    print 'remctl remote control <machine> <command>'
30    if args:
31        for name in args:
32            print_help(name, helpdict[name])
33    else:
34        for name, text in help:
35            print_help(name, text)
36       
37    return 0
38
39if __name__ == '__main__':
40    sys.exit(main(sys.argv[1:]))
41
42# vim:et:sw=4:ts=4
Note: See TracBrowser for help on using the repository browser.