Creates and returns an ArgumentParser containing default values which were read from the config file.
()
| 409 | |
| 410 | |
| 411 | def _get_parser() -> argparse.ArgumentParser: |
| 412 | """ |
| 413 | Creates and returns an ArgumentParser containing default values which were |
| 414 | read from the config file. |
| 415 | """ |
| 416 | parser = argparse.ArgumentParser(description=__doc__) |
| 417 | parser.add_argument( |
| 418 | "hours", |
| 419 | help="Fetch issues that have been updated since this many hours ago", |
| 420 | type=int, |
| 421 | ) |
| 422 | parser.add_argument( |
| 423 | "-c", |
| 424 | "--config", |
| 425 | help="Path to configuration file", |
| 426 | type=str, |
| 427 | ) |
| 428 | parser.add_argument( |
| 429 | "-s", |
| 430 | "--slack-channel", |
| 431 | help="Issues will be published to this Slack channel. Publishing to Slack will be skipped if this argument is missing, or is an empty string", |
| 432 | type=str, |
| 433 | ) |
| 434 | parser.add_argument( |
| 435 | "--no-labels", |
| 436 | help="Prevent the script from labeling the issues", |
| 437 | action="store_true", |
| 438 | ) |
| 439 | parser.add_argument( |
| 440 | "-v", |
| 441 | "--verbose", |
| 442 | help="Print detailed information about the issues that were found", |
| 443 | action="store_true", |
| 444 | ) |
| 445 | |
| 446 | return parser |
| 447 | |
| 448 | |
| 449 | if __name__ == "__main__": |