mirror of https://github.com/kdabir/has.git
Compare commits
2 Commits
227c909067
...
f0e6f43221
Author | SHA1 | Date |
---|---|---|
Christian Clauss | f0e6f43221 | |
Arkoprabho Chakraborti | 61032d63f1 |
|
@ -17,6 +17,7 @@ jobs:
|
|||
name: test
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
container:
|
||||
- debian # uses debian:buster-20200327-slim which is debian 10.3
|
||||
|
@ -36,6 +37,7 @@ jobs:
|
|||
name: test_all
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
container:
|
||||
- ubuntu # uses ubuntu:bionic-20200311 which is ubuntu 18.04
|
||||
|
|
35
has
35
has
|
@ -15,16 +15,22 @@ if [[ ! -t 1 ]]; then
|
|||
elif [[ -z $TERM ]]; then
|
||||
TERM="xterm"
|
||||
fi
|
||||
readonly txtreset="$(tput -T $TERM sgr0)"
|
||||
readonly txtbold="$(tput -T $TERM bold)"
|
||||
readonly txtblack="$(tput -T $TERM setaf 0)"
|
||||
readonly txtred="$(tput -T $TERM setaf 1)"
|
||||
readonly txtgreen="$(tput -T $TERM setaf 2)"
|
||||
readonly txtyellow="$(tput -T $TERM setaf 3)"
|
||||
readonly txtblue="$(tput -T $TERM setaf 4)"
|
||||
readonly txtpurple="$(tput -T $TERM setaf 5)"
|
||||
readonly txtcyan="$(tput -T $TERM setaf 6)"
|
||||
readonly txtwhite="$(tput -T $TERM setaf 7)"
|
||||
|
||||
txtreset="$(tput -T "$TERM" sgr0)"
|
||||
readonly txtreset
|
||||
|
||||
txtbold="$(tput -T "$TERM" bold)"
|
||||
readonly txtbold
|
||||
|
||||
txtred="$(tput -T "$TERM" setaf 1)"
|
||||
readonly txtred
|
||||
|
||||
txtgreen="$(tput -T "$TERM" setaf 2)"
|
||||
readonly txtgreen
|
||||
|
||||
txtyellow="$(tput -T "$TERM" setaf 3)"
|
||||
readonly txtyellow
|
||||
|
||||
# unicode "✗"
|
||||
readonly fancyx='\342\234\227'
|
||||
# unicode "✓"
|
||||
|
@ -38,7 +44,7 @@ readonly FAIL="${txtbold}${txtred}${fancyx}${txtreset}"
|
|||
COLOR_AUTO="auto"
|
||||
COLOR_NEVER="never"
|
||||
COLOR_ALWAYS="always"
|
||||
COLOR_OPTS=(${COLOR_AUTO} ${COLOR_NEVER} ${COLOR_ALWAYS})
|
||||
COLOR_OPTS=("${COLOR_AUTO} ${COLOR_NEVER} ${COLOR_ALWAYS}")
|
||||
COLOR="${COLOR_AUTO}"
|
||||
COLOR_PREFIX="--color"
|
||||
|
||||
|
@ -335,7 +341,6 @@ OUTPUT=/dev/stdout
|
|||
while getopts ":qhv-" OPTION; do
|
||||
case "$OPTION" in
|
||||
q)
|
||||
QUIET="true"
|
||||
OUTPUT=/dev/null
|
||||
;;
|
||||
h)
|
||||
|
@ -347,10 +352,10 @@ while getopts ":qhv-" OPTION; do
|
|||
exit 0
|
||||
;;
|
||||
-)
|
||||
[ $OPTIND -ge 1 ] && optind=$(expr $OPTIND - 1) || optind=$OPTIND
|
||||
[ $OPTIND -ge 1 ] && optind=$((OPTIND - 1)) || optind=$OPTIND
|
||||
eval OPTION="\$$optind"
|
||||
OPTARG=$(echo $OPTION | cut -d'=' -f2)
|
||||
OPTION=$(echo $OPTION | cut -d'=' -f1)
|
||||
OPTARG=$(echo "$OPTION" | cut -d'=' -f2)
|
||||
OPTION=$(echo "$OPTION" | cut -d'=' -f1)
|
||||
case $OPTION in
|
||||
--version)
|
||||
_version
|
||||
|
|
Loading…
Reference in New Issue