summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2016-12-07 22:26:54 -0800
committerSteve Piercy <web@stevepiercy.com>2016-12-13 17:39:00 -0800
commite96b2b5d5b9ebab33cd6eb84ef498dbaf4da18cb (patch)
tree88c9f803762ee403a3ba3856b44374a2ee429145
parent83fb105cd8a5c0fff4aa8da35ee43c48c7b0424e (diff)
downloadpyramid-e96b2b5d5b9ebab33cd6eb84ef498dbaf4da18cb.tar.gz
pyramid-e96b2b5d5b9ebab33cd6eb84ef498dbaf4da18cb.tar.bz2
pyramid-e96b2b5d5b9ebab33cd6eb84ef498dbaf4da18cb.zip
add an argument `config_args` to be parsed and passed into bootstrap's options
-rw-r--r--pyramid/scripts/proutes.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pyramid/scripts/proutes.py b/pyramid/scripts/proutes.py
index 92ec48ed1..cf3ae5e9c 100644
--- a/pyramid/scripts/proutes.py
+++ b/pyramid/scripts/proutes.py
@@ -273,6 +273,14 @@ class PRoutesCommand(object):
help='The URI to the configuration file.',
)
+ parser.add_argument(
+ 'config_args',
+ nargs='*',
+ default=(),
+ help='Arbitrary options to override those in the [app:main] section '
+ 'of the configuration file.',
+ )
+
def __init__(self, argv, quiet=False):
self.args = self.parser.parse_args(argv[1:])
self.quiet = quiet
@@ -327,7 +335,7 @@ class PRoutesCommand(object):
return 2
config_uri = self.args.config_uri
- env = self.bootstrap[0](config_uri, options=vars(self.args))
+ env = self.bootstrap[0](config_uri, options=parse_vars(self.args.config_args))
registry = env['registry']
mapper = self._get_mapper(registry)