~nijaba/vmbuilder/rawsize-lp303882

« back to all changes in this revision

Viewing changes to VMBuilder/plugins/cli/__init__.py

  • Committer: Soren Hansen
  • Date: 2008-10-23 21:11:22 UTC
  • Revision ID: soren@canonical.com-20081023211122-kmes2wxdp61d0tr9
Make the CLI plugin automatically echo the config option is it's not completely obvious.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
            vm.register_setting('--raw', metavar='PATH', type='string', help="Specify a file (or block device) to as first disk image.")
49
49
            vm.register_setting('--part', metavar='PATH', type='string', help="Allows to specify a partition table in PATH each line of partfile should specify (root first): \n    mountpoint size \none per line, separated by space, where size is in megabytes. You can have up to 4 virtual disks, a new disk starts on a line containing only '---'. ie: \n    root 2000 \n    /boot 512 \n    swap 1000 \n    --- \n    /var 8000 \n    /var/log 2000")
50
50
            self.set_usage(vm)
 
51
 
51
52
            vm.optparser.disable_interspersed_args()
52
53
            (foo, args) = vm.optparser.parse_args()
53
54
            self.handle_args(vm, args)
54
55
            vm.optparser.enable_interspersed_args()
 
56
 
 
57
            for opt in vm.optparser.option_list + sum([grp.option_list for grp in vm.optparser.option_groups], []):
 
58
                if len(opt._long_opts) > 1 or (opt.action == 'store' and opt._long_opts[0][2:] != opt.dest):
 
59
                    opt.help += " Config option: %s" % opt.dest
 
60
 
55
61
            (settings, args) = vm.optparser.parse_args(values=optparse.Values())
56
62
            for (k,v) in settings.__dict__.iteritems():
57
63
                setattr(vm, k, v)