4 from naja.attrdict import AttrDict
5 from naja.constants import DEFAULTS
13 Parse arguments and store them in the options dictionary.
15 Note: If you add arguments, you need to add an appropriate default to the
18 options.update(DEFAULTS)
20 options.debug = 'DEBUG' in os.environ
22 parser = optparse.OptionParser()
23 parser.add_option('--no-sound',
24 dest='sound', action='store_false', default=True,
25 help='Disable all sound, including music')
27 parser.add_option('--no-music',
28 dest='music', action='store_false', default=True,
29 help='Disable music (but not sound)')
31 opts, _ = parser.parse_args(args)
34 if getattr(opts, k, None) is not None:
35 options[k] = getattr(opts, k)