| 335 | |
| 336 | # Move plugin parameters to end of argument list |
| 337 | def moveUnknownToEnd(self, argv, default_action): |
| 338 | valid_actions = sum([action.option_strings for action in self.parser._actions], []) |
| 339 | valid_parameters = [] |
| 340 | plugin_parameters = [] |
| 341 | plugin = False |
| 342 | for arg in argv: |
| 343 | if arg.startswith("--"): |
| 344 | if arg not in valid_actions: |
| 345 | plugin = True |
| 346 | else: |
| 347 | plugin = False |
| 348 | elif arg == default_action: |
| 349 | plugin = False |
| 350 | |
| 351 | if plugin: |
| 352 | plugin_parameters.append(arg) |
| 353 | else: |
| 354 | valid_parameters.append(arg) |
| 355 | return valid_parameters + plugin_parameters |
| 356 | |
| 357 | # Parse arguments from config file and command line |
| 358 | def parse(self, silent=False, parse_config=True): |