summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--subcmds/forall.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/subcmds/forall.py b/subcmds/forall.py
index 4ea7db66..a2ccb7b6 100644
--- a/subcmds/forall.py
+++ b/subcmds/forall.py
@@ -115,13 +115,15 @@ without iterating through the remaining projects.
115""" 115"""
116 PARALLEL_JOBS = DEFAULT_LOCAL_JOBS 116 PARALLEL_JOBS = DEFAULT_LOCAL_JOBS
117 117
118 @staticmethod
119 def _cmd_option(option, _opt_str, _value, parser):
120 setattr(parser.values, option.dest, list(parser.rargs))
121 while parser.rargs:
122 del parser.rargs[0]
123
118 def _Options(self, p): 124 def _Options(self, p):
119 super()._Options(p) 125 super()._Options(p)
120 126
121 def cmd(option, opt_str, value, parser):
122 setattr(parser.values, option.dest, list(parser.rargs))
123 while parser.rargs:
124 del parser.rargs[0]
125 p.add_option('-r', '--regex', 127 p.add_option('-r', '--regex',
126 dest='regex', action='store_true', 128 dest='regex', action='store_true',
127 help="Execute the command only on projects matching regex or wildcard expression") 129 help="Execute the command only on projects matching regex or wildcard expression")
@@ -136,7 +138,7 @@ without iterating through the remaining projects.
136 help='Command (and arguments) to execute', 138 help='Command (and arguments) to execute',
137 dest='command', 139 dest='command',
138 action='callback', 140 action='callback',
139 callback=cmd) 141 callback=self._cmd_option)
140 p.add_option('-e', '--abort-on-errors', 142 p.add_option('-e', '--abort-on-errors',
141 dest='abort_on_errors', action='store_true', 143 dest='abort_on_errors', action='store_true',
142 help='Abort if a command exits unsuccessfully') 144 help='Abort if a command exits unsuccessfully')