The main function. Pre-process args, handle some special types of invocations, and run the main program with error handling. Return exit status code.
(
args: List[Union[str, bytes]] = sys.argv,
env: Environment = Environment()
)
| 144 | |
| 145 | |
| 146 | def main( |
| 147 | args: List[Union[str, bytes]] = sys.argv, |
| 148 | env: Environment = Environment() |
| 149 | ) -> ExitStatus: |
| 150 | """ |
| 151 | The main function. |
| 152 | |
| 153 | Pre-process args, handle some special types of invocations, |
| 154 | and run the main program with error handling. |
| 155 | |
| 156 | Return exit status code. |
| 157 | |
| 158 | """ |
| 159 | |
| 160 | from .cli.definition import parser |
| 161 | |
| 162 | return raw_main( |
| 163 | parser=parser, |
| 164 | main_program=program, |
| 165 | args=args, |
| 166 | env=env |
| 167 | ) |
| 168 | |
| 169 | |
| 170 | def program(args: argparse.Namespace, env: Environment) -> ExitStatus: |
no test coverage detected