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

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

provide help on 'remctl remote help help' etc

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