diff options
author | ryuslash | 2010-02-09 01:32:42 +0100 |
---|---|---|
committer | ryuslash | 2010-02-09 01:32:42 +0100 |
commit | 32c4471273097523d64ad0f7704861f211e78f72 (patch) | |
tree | f2fc37c1f38373d3c35e3267b2489eac23fe7edf /4grab.py | |
parent | 53c7802ae2ef25ebed4e130813ce95e2816c919b (diff) | |
download | 4grab-32c4471273097523d64ad0f7704861f211e78f72.tar.gz 4grab-32c4471273097523d64ad0f7704861f211e78f72.zip |
working on the command-line arguments here
Diffstat (limited to '4grab.py')
-rw-r--r-- | 4grab.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/4grab.py b/4grab.py new file mode 100644 index 0000000..4de6526 --- /dev/null +++ b/4grab.py @@ -0,0 +1,17 @@ +import optparse +import sys + +import config + +parser = optparse.OptionParser() + +parser.add_option("-e", nargs=2, dest="confval", metavar="VALUE") + +(options, args) = parser.parse_args() + +if options.confval: + if not config.Configuration().option_exists(options.confval[0]): + print "%s: error: %s is not a valid configuration option" % (sys.argv[0], options.confval[0]) + exit(1) + print "Setting", options.confval[0], "to", options.confval[1] + config.Configuration(). |