From 2a69145c5232add1453ba8b9d90eacc2c42e70ee Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Mon, 12 Jan 2009 05:02:58 -0600 Subject: [PATCH] Default flag render char is now the hex number for that cell. --- flag | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flag b/flag index 02cad2f..479fd83 100755 --- a/flag +++ b/flag @@ -124,7 +124,6 @@ flag() { data="${1}" sym="${2}" shm="${3}" - [ -z "${sym}" ] && sym=" " [ -n "${shm}" ] && open='\\[' shut='\\]' while [ -n "${data}" ] do @@ -134,7 +133,7 @@ flag() { [ "$(( ${ord} & 8 ))" -gt 0 ] && bright="1" fore="3$(( ${ord} & 7 ))" back="4$(( ${ord} & 7 ))" - printf "${open}\033[%s;%s;%s;7m${shut}%s" "${bright}" "${fore}" "${back}" "${sym}" + printf "${open}\033[%s;%s;%s;7m${shut}%s" "${bright}" "${fore}" "${back}" "${sym:-${char}}" done printf "${open}\033[0m${shut}" } @@ -149,7 +148,7 @@ pebkac() { echo " don't send stupid commands to the wrong machine." echo " " echo " -s # Specify which character should be used to" - echo " render the flag" + echo " render the flag. If empty, use the hex code." echo " -e Turn on bash encapsulation mode, to provide" echo " hints to Bash on what is or is not printable" echo " so it can wrap your commands appropriately" @@ -159,7 +158,7 @@ pebkac() { exit 1 } -symbol=" " +symbol="" shellmode="" while [ -n "${1}" ] -- 2.42.0