diff --git a/.gitignore b/.gitignore index fa1554f..58ca1a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *~ *.pyc -#*# +\#*\# .* \ No newline at end of file diff --git a/4grab.py b/4grab.py index adb47ca..dbefd78 100755 --- a/4grab.py +++ b/4grab.py @@ -35,9 +35,14 @@ This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.""") parser.add_option("-e", nargs=2, dest="confval", metavar="CONF VALUE", help="Set configuration option CONF to be VALUE") +parser.add_option("-c", "--category", dest="tempcat", metavar="CATEGORY", help="Set the category to CATEGORY only for this run") (options, args) = parser.parse_args() +if options.confval and options.tempcat: + print "Cannot set a value and download" + exit(1) + 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]) @@ -46,6 +51,8 @@ if options.confval: config.Configuration().set_option(options.confval[0], options.confval[1]) config.Configuration().save() exit(0) +elif options.tempcat: + config.Configuration().set_category(options.tempcat) base_url = "http://boards.4chan.org/%s/" % (config.Configuration().get_category())