| 63 | |
| 64 | |
| 65 | def _parse_args(): |
| 66 | _parser = argparse.ArgumentParser(description=__doc__) |
| 67 | _parser.add_argument( |
| 68 | "-c", |
| 69 | "--config", |
| 70 | default=DEFAULT_CONFIG_PATH, |
| 71 | help=f'Path to cron-wrapper configuration file. Defaults to "{DEFAULT_CONFIG_PATH}"', |
| 72 | ) |
| 73 | _parser.add_argument("monitor_slug", help="Monitor slug of the Sentry cron monitor") |
| 74 | _parser.add_argument("script", help="Path to script that will be wrapped and monitored") |
| 75 | _parser.add_argument( |
| 76 | "script_args", |
| 77 | nargs=argparse.REMAINDER, |
| 78 | help="Arguments for the wrapped script", |
| 79 | ) |
| 80 | _parser.set_defaults(func=main) |
| 81 | |
| 82 | return _parser |
| 83 | |
| 84 | |
| 85 | if __name__ == "__main__": |