reverse coloring variable
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
_qColVersion() { echo Version 2018.10.23.0; }
|
||||
_qColVersion() { echo Version 2018.12.23.0; }
|
||||
|
||||
_qColHelp() {
|
||||
_qColVersion
|
||||
@@ -30,7 +30,13 @@ Examples:
|
||||
_qCol export _c
|
||||
echo -e ${_cG}Title${_cZ}
|
||||
|
||||
Run qolop as script to print ANSI code table
|
||||
Run qolop as script to print ANSI code table, or evaluate commands
|
||||
|
||||
qolop eval "_qCol G; printf hello; _qCol z" | qolop export
|
||||
|
||||
The first command produces string with ANSI commands, the
|
||||
second will escape the escape characters, so you can copy/paste
|
||||
it in to another echo -e command.
|
||||
'
|
||||
}
|
||||
|
||||
@@ -123,6 +129,9 @@ _qPos() {
|
||||
[[ "$1" = "linedown" ]] && { printf '\033['${n}'F'; return; }
|
||||
[[ "$1" = "col" ]] && { printf '\033['${n}'G'; return; }
|
||||
[[ "$1" = "abs" ]] && { printf '\033['${n}';'${x}'H'; return; }
|
||||
echo "Command missing: save, restore, up, down, right, left, lineup, linedown, col, abs" >&2
|
||||
echo "Directional commands take one argument, abs uses two (row, col)" >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
_qClr() {
|
||||
@@ -170,6 +179,17 @@ if [[ "$0" = "${BASH_SOURCE[0]}" ]]; then
|
||||
rm -f "$TMPFILE"
|
||||
exit 0
|
||||
} # end update
|
||||
[[ "$1" = "eval" ]] && {
|
||||
set -e
|
||||
eval "$@"
|
||||
exit
|
||||
}
|
||||
[[ "$1" = "export" ]] && {
|
||||
cat - | sed s/$'\e'/\\\\033/g
|
||||
echo ''
|
||||
exit
|
||||
}
|
||||
|
||||
_qColHelp
|
||||
[[ "$1" = *"help" ]] && exit
|
||||
[[ "$1" = "-h" ]] && exit
|
||||
|
||||
Reference in New Issue
Block a user