equal
deleted
inserted
replaced
13 |
13 |
14 # create parser using the given command |
14 # create parser using the given command |
15 parser = OptionParser(prog=command_name) |
15 parser = OptionParser(prog=command_name) |
16 |
16 |
17 # define options |
17 # define options |
18 parser.add_option('-G', "--gallery-path", dest='gallery_path', help="Use DIR as the Gallery path [default: CWD]", metavar='DIR', default=None) |
18 parser.add_option('-G', "--gallery-path", metavar='DIR', dest='gallery_path', default=None, |
19 parser.add_option('-R', "--read-only", dest='read_only', help="Do not attempt to modify the gallery", action="store_true", default=False) |
19 help="Use DIR as the Gallery path [default: CWD]") |
|
20 |
|
21 parser.add_option('-R', "--read-only", dest='read_only', action="store_true", default=False, |
|
22 help="Do not attempt to modify the gallery") |
|
23 |
|
24 parser.add_option('-F', "--force-update", dest='force_update', action="store_true", default=False, |
|
25 help="Force updates, even for fresh items") |
20 |
26 |
21 return parser |
27 return parser |
22 |
28 |
23 def build_config (options) : |
29 def build_config (options) : |
24 """ |
30 """ |
32 if options.gallery_path : |
38 if options.gallery_path : |
33 config.gallery_path = options.gallery_path |
39 config.gallery_path = options.gallery_path |
34 |
40 |
35 if options.read_only : |
41 if options.read_only : |
36 config.read_only = True |
42 config.read_only = True |
|
43 |
|
44 if options.force_update : |
|
45 config.force_update = True |
37 |
46 |
38 # XXX: load config file(s) |
47 # XXX: load config file(s) |
39 |
48 |
40 return config |
49 return config |
41 |
50 |