mirror of
https://github.com/spf13/cobra
synced 2025-05-06 05:17:21 +00:00
Update documentation to clearly indicate Persistent*Run order
This commit is contained in:
parent
f098247d23
commit
366025099b
1 changed files with 1 additions and 1 deletions
|
@ -586,7 +586,7 @@ the version template. The template can be customized using the
|
|||
|
||||
## PreRun and PostRun Hooks
|
||||
|
||||
It is possible to run functions before or after the main `Run` function of your command. The `PersistentPreRun` and `PreRun` functions will be executed before `Run`. `PersistentPostRun` and `PostRun` will be executed after `Run`. The `Persistent*Run` functions will be inherited by children if they do not declare their own. These functions are run in the following order:
|
||||
It is possible to run functions before or after the main `Run` function of your command. The `PersistentPreRun` and `PreRun` functions will be executed before `Run`. `PersistentPostRun` and `PostRun` will be executed after `Run`. If parent and child commands declare `Persistent*Run` functions, they will be run in order from parent to child. These functions are run in the following order:
|
||||
|
||||
- `PersistentPreRun`
|
||||
- `PreRun`
|
||||
|
|
Loading…
Add table
Reference in a new issue