Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add pre_argument_parsing/post_argument_parsing hooks #194
Title original referenced 'pre_dispatch/post_dispatch' hooks.
There are a lot of situations where I want to access app.pargs.foo after arguments are parsed, but before the actually logic of the app starts in app.run(). The pre_run hook happens before arguments are parsed, and the post_run hook happens after the logic of the app happens (when using application controllers). Having a pre_dispatch hook would allow us to access app.pargs.foo before application logic runs.
Might also be more appropriate, and easier to implement to have a pre_argument_parsing, post_argument_parsing hook instead. Dispatch is actually the 'running' of the app, so pre_run/post_run are pretty accurate for that. pre/post argument parsing would happen in the middle of run/dipatch.