aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/gmg_commands/util.py
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2011-10-23 12:47:25 +0200
committerElrond <elrond+mediagoblin.org@samba-tng.org>2011-10-23 12:47:25 +0200
commit9043e7a012c0b01a993e04831180005ff36730d6 (patch)
treec71f64bdfa9b55ffde8e17f97726bbb2d437956c /mediagoblin/gmg_commands/util.py
parenteb5bb3fc997da26a39d6d77888574b634f00db57 (diff)
downloadmediagoblin-9043e7a012c0b01a993e04831180005ff36730d6.tar.lz
mediagoblin-9043e7a012c0b01a993e04831180005ff36730d6.tar.xz
mediagoblin-9043e7a012c0b01a993e04831180005ff36730d6.zip
Refactor gmg's cf option into a function
Many (all?) gmg subcommands take a -cf option to change the used config file. This options used to be created in each subcommand's parse_setup. Add a helper function and use it around.
Diffstat (limited to 'mediagoblin/gmg_commands/util.py')
-rw-r--r--mediagoblin/gmg_commands/util.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mediagoblin/gmg_commands/util.py b/mediagoblin/gmg_commands/util.py
index 168a0760..02febd2c 100644
--- a/mediagoblin/gmg_commands/util.py
+++ b/mediagoblin/gmg_commands/util.py
@@ -25,3 +25,12 @@ def setup_app(args):
mgoblin_app = app.MediaGoblinApp(args.conf_file)
return mgoblin_app
+
+
+def option_add_conffile(subparser):
+ """
+ Add the -cf option to a subparser
+ """
+ subparser.add_argument(
+ '-cf', '--conf_file', default='mediagoblin.ini',
+ help="Config file used to set up environment")