From e96b2b5d5b9ebab33cd6eb84ef498dbaf4da18cb Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 7 Dec 2016 22:26:54 -0800 Subject: add an argument `config_args` to be parsed and passed into bootstrap's options --- pyramid/scripts/proutes.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3