nuno ha revisionato questo gist 1 month ago. Vai alla revisione
1 file changed, 15 insertions
gistfile1.txt(file creato)
| @@ -0,0 +1,15 @@ | |||
| 1 | + | local subcmd_file="$(ctx::commands)/${cmd}/${subcmd}.sh" | |
| 2 | + | if [[ -f "$subcmd_file" ]]; then | |
| 3 | + | _CURRENT_LOADING_CMD="${cmd}::${subcmd}" | |
| 4 | + | _CURRENT_COMMAND="${cmd}::${subcmd}" | |
| 5 | + | source "$subcmd_file" | |
| 6 | + | core::call_if_exists "cmd::${cmd}::${subcmd}::on_load" | |
| 7 | + | _CURRENT_LOADING_CMD="" | |
| 8 | + | ||
| 9 | + | for arg in "$@"; do | |
| 10 | + | [[ "$arg" == "--help" || "$arg" == "-h" ]] && { | |
| 11 | + | hook::fire "command:help:${cmd}" "$cmd" "$_ROUTED_SUBCMD" | |
| 12 | + | return 0 | |
| 13 | + | } | |
| 14 | + | done | |
| 15 | + | fi | |
Più nuovi
Più vecchi