~dell-team/usb-creator/command-line-args

« back to all changes in this revision

Viewing changes to bin/usb-creator

  • Committer: Mario Limonciello
  • Date: 2008-10-31 20:25:06 UTC
  • Revision ID: mario_limonciello@dell.com-20081031202506-ksyrgkdarg84ktjt
add support for defaulting the persistence setting of the UI via commandline

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
usage = '%prog [options]'
23
23
parser = optparse.OptionParser(usage=usage, version='0.1.11')
24
24
parser.set_defaults(
25
 
    safe=False,iso=None)
 
25
    safe=False,iso=None,persistent=True)
26
26
parser.add_option('-s', '--safe', dest='safe', action='store_true',
27
27
                  help='choose safer options when constructing the USB '
28
28
                  'disk (may slow down the boot process).')
29
29
parser.add_option('-i', '--iso', dest='iso',
30
30
                  help='provide a source ISO to pre-populate the UI.')
 
31
parser.add_option('-n', '--not_persistent', dest='persistent', action="store_false",
 
32
                  help='disable persistent setting by default in the UI')
31
33
(options, args) = parser.parse_args()
32
34
if options.safe:
33
35
    os.environ['USBCREATOR_SAFE'] = '1'
39
41
    os.execvp(args[0], args)
40
42
 
41
43
# TODO: trap sigterm, hook into copy shutdown routine.
42
 
f = GtkFrontend(options.iso)
 
44
f = GtkFrontend(options.iso,options.persistent)