diff --git a/helpers/help.sh b/helpers/help.sh new file mode 100644 index 0000000..2572a23 --- /dev/null +++ b/helpers/help.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +#TODO source basic.sh +#TODO source args-parser/args.sh + +######################################################## +# Help functions +######################################################## + +process_help_arg() { + command="${FUNCNAME[1]}" + need_help=$(arg help 1) + [[ "$need_help" -eq 0 ]] && need_help=$(argl help 1) + [[ "$need_help" -eq 1 ]] && help "$command" +} + +help() { + is_function "help.$1" && help."$1" && exit + echo "Main help message" +} + +help.example() { + echo "Example help message" +} + +example() { + process_help_arg + echo "Example command" +}