diff options
Diffstat (limited to 'cac')
-rwxr-xr-x | cac | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -64,12 +64,22 @@ cac() { } #? cac help -#? Print this help message. +#? Show this help message. #? __cac_cli__help() {( + # test -t expects GNU coreutils + if test -t 0 >/dev/null 2>&1; then + filter() { + $PAGER "$@" + } + else + filter() { + cat "$@" + } + fi exec sed < "$0" -n ' s/^#?\( \(.*\)\)\?/\2/p - ' + ' | filter )} #? cac console SERVERSPEC |