Parse command line arguments.
()
| 90 | |
| 91 | |
| 92 | def build_parser(): |
| 93 | """Parse command line arguments.""" |
| 94 | parser = argparse.ArgumentParser( |
| 95 | formatter_class=argparse.RawTextHelpFormatter, epilog=__doc__) |
| 96 | |
| 97 | parser.add_argument('--wait-sec', type=int, |
| 98 | help='Wait and retry update every specified number of seconds. ' \ |
| 99 | 'Minimum value is 30s to avoid overwhelming Gerrit.') |
| 100 | parser.set_defaults(func=update) |
| 101 | parser.add_argument('--verbose', |
| 102 | action='store_true', |
| 103 | help='Show more debugging info') |
| 104 | |
| 105 | #Deprecated options. These are no longer used, but are kept here |
| 106 | #to avoid breaking existing scripts.""" |
| 107 | parser.add_argument('--patchset', |
| 108 | help='Deprecated. Not used by this tool.') |
| 109 | parser.add_argument('--ignore-failed', |
| 110 | help='Deprecated. Not used by this tool.') |
| 111 | parser.add_argument('--retry', help='Deprecated. Not used by this tool.') |
| 112 | |
| 113 | return parser |
| 114 | |
| 115 | def update(project_config, options): |
| 116 | test_clean_git() |