Use true/false for readability

This commit is contained in:
Jeremy Gardais 2020-03-11 16:48:35 +01:00
parent d55dc58c87
commit 32a58d8c83
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 7 additions and 7 deletions

View File

@ -10,8 +10,8 @@
# Vars [[[
debug="0"
flag_clipboard=1
flag_inline=1
flag_clipboard=false
flag_inline=false
null_service_url="https://null.101010.fr"
@ -26,11 +26,11 @@ c_reset='\033[0m'
# Verify argument [[[
case "$#" in
0 )
flag_clipboard=0
flag_clipboard=true
[ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG Verify arg: No argument was given, try to use clipboard."
;;
1 )
flag_inline=0
flag_inline=true
[ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG Verify arg: One argument was given, use it."
;;
* )
@ -42,15 +42,15 @@ esac
# Get URL to be shortened [[[
# Try to get URL from first argument
if [ ${flag_inline} ]; then
if [ "${flag_inline}" = "true" ]; then
url_to_short="${1}"
fi
# Try to get URL from clipboard
if [ "${flag_clipboard}" ]; then
if [ "${flag_clipboard}" = "true" ]; then
url_to_short=$(xclip -out)
fi
[ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG: URL to be shortened: ${url_to_short}"
[ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG Get URL: URL to be shortened: ${url_to_short}"
# ]]]
# shorten URL