1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00
nux-env/inc/nux/help.nuxsh.sh
Tony Tkacik 59b79ea88e *: rewrite some files to nuxsh.
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
2017-07-16 18:39:13 +02:00

21 lines
567 B
Bash

#!/usr/bin/env nuxsh
@namespace nux.help. {
function :shelldoc {
sed -r \
-e "s/^## ?(.*)/${NC_White}\1${NC_No}/gI" \
-e "s/^# ?(.*)/${NC_Bold}\1${NC_No}/gI" \
-e "s/^([ a-z0-9.-_]*)::/${NC_Bold}\1${NC_No}/gI" \
-e "s/\*\*([^*]*)\*\*/${NC_Bold}\1${NC_No}/gI" \
-e "s/\*([^*]*)\*/${NC_White}\1${NC_No}/gI" \
--
}
function :comment source {
if nux.check.file.exists "$source" ; then
grep -E "^\#\#( |$)" "$source" \
| cut -d\# -f3- \
| cut -d" " -f2- \
| nux.help.shelldoc
fi
}
}