fixed syntax highlighting
This commit is contained in:
parent
41b0293d42
commit
c0608baa7b
17
en
17
en
@ -16,8 +16,10 @@ fi
|
||||
|
||||
if test -z "$1"; then
|
||||
set -- /dev/stdin
|
||||
HIGHLIGHT_OPTIONS="$HIGHLIGHT_OPTIONS --syntax=none"
|
||||
export HIGHLIGHT_OPTIONS
|
||||
export HIGHLIGHT_OPTIONS="$HIGHLIGHT_OPTIONS -S none"
|
||||
else
|
||||
export HIGHLIGHT_OPTIONS="$HIGHLIGHT_OPTIONS -S \
|
||||
$(printf '%s\n' "$1" | sed 's/^.*\.//g')"
|
||||
fi
|
||||
|
||||
help="$(printf "Commands:\n\
|
||||
@ -70,7 +72,7 @@ while test -n "$1"; do
|
||||
"c") clear ;;
|
||||
"d")
|
||||
if test -z "$args"; then
|
||||
printf "%s: %s: Missing argument.\n" "$0" "$command" 1>&2
|
||||
printf "%s: %s: missing argument.\n" "$0" "$command" 1>&2
|
||||
else
|
||||
for line in $(printf "%s\n" "$args" | sed 's/,/\n/g')
|
||||
do
|
||||
@ -82,12 +84,9 @@ while test -n "$1"; do
|
||||
"e")
|
||||
eval "$args" || true
|
||||
;;
|
||||
"h")
|
||||
HIGHLIGHT_OPTIONS="$HIGHLIGHT_OPTIONS --syntax=$args"
|
||||
export HIGHLIGHT_OPTIONS
|
||||
;;
|
||||
"h") export HIGHLIGHT_OPTIONS="$HIGHLIGHT_OPTIONS -S $args" ;;
|
||||
"i")
|
||||
printf "%s: i: Command not implemented.\n" "$0" 1>&2
|
||||
printf "%s: i: command not implemented.\n" "$0" 1>&2
|
||||
;;
|
||||
"p")
|
||||
printf "%s\n" "$content" | highlight | nl -ba >/dev/tty
|
||||
@ -99,7 +98,7 @@ while test -n "$1"; do
|
||||
"x") exit ;;
|
||||
"") ;;
|
||||
*)
|
||||
printf "%s: %s: unrecognized command\n" "$0" "$command"
|
||||
printf "%s: %s: unrecognized command\n%s\n" "$0" "$command" "$help"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user