1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00

shelldoc: Added micro markup support for shell comments.

Added support for micro markup to ease reading and to
highlight keywords and headings in documentation derived
from shell comments.

nuxfs and nux-runner takes advantage from this.

Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
Tony Tkáčik 2017-06-11 17:23:55 +02:00
parent 91cb61527f
commit 089cb5ccce
3 changed files with 105 additions and 25 deletions

View file

@ -16,33 +16,32 @@ readonly NUX_RUNNER=$NUX_RUNNER_BIN_DIR/nux-runner;
nux.include nux-runner
##
## Tasks provided by 'nux-runner':
## Commands provided by 'nux-runner':
## debug - Runs specified task with debug messages enabled.
## debug Runs specified task with debug messages enabled.
task.debug() {
N_LOG_debug=1
nux-runner.run "$@"
}
## trace - Runs specified task with debug & trace enabled.
## trace Runs specified task with debug & trace enabled.
task.trace() {
N_LOG_debug=1;
N_LOG_trace=2;
nux-runner.run "$@"
}
## help - Shows this help
## help Shows this help
task.help() {
echo Usage: $NUX_SCRIPTNAME [task] [options]
echo Usage: $NC_Bold$NUX_SCRIPTNAME ${NC_No}${NC_White}\<command\>${NC_No} [\<options\>]
echo
grep "^\#\#\# " "$NUX_SCRIPT" | cut -d\# -f4-
echo
echo " Available Tasks: "
grep "^\#\# " "$NUX_SCRIPT" | cut -d\# -f3-
echo
grep "^\#\# " "$NUX_RUNNER" | cut -d\# -f3-
grep -E "^\#\#\#( |$)" "$NUX_SCRIPT" | cut -d\# -f4- | cut -d" " -f2- | nux.help.shelldoc
echo
echo "Available Commands: "
nux.help.comment "$NUX_SCRIPT"
nux.help.comment "$NUX_RUNNER"
nux.exec.optional task.help.detailed
}
##