Creates the parsers and returns the args
(providers)
| 38 | |
| 39 | |
| 40 | def get_args(providers): |
| 41 | """ Creates the parsers and returns the args """ |
| 42 | # Create the top-level parser |
| 43 | parser = argparse.ArgumentParser(prog='pgacloud.py') |
| 44 | |
| 45 | # Create the provider sub-parser |
| 46 | parsers = parser.add_subparsers(help='provider help', dest='provider') |
| 47 | |
| 48 | # Load the provider parsers |
| 49 | for provider in providers: |
| 50 | providers[provider].init_args(parsers) |
| 51 | |
| 52 | args = parser.parse_args() |
| 53 | |
| 54 | return parser, args |
| 55 | |
| 56 | |
| 57 | def execute_command(providers, parser, args): |