Take an existing argparse parser, and create a spec from it.
(parser: argparse.ArgumentParser, **kwargs)
| 240 | |
| 241 | |
| 242 | def parser_to_parser_spec(parser: argparse.ArgumentParser, **kwargs) -> ParserSpec: |
| 243 | """Take an existing argparse parser, and create a spec from it.""" |
| 244 | return ParserSpec( |
| 245 | program=parser.prog, |
| 246 | description=parser.description, |
| 247 | epilog=parser.epilog, |
| 248 | **kwargs |
| 249 | ) |