diff --git a/url.shortme.sh b/url.shortme.sh index 8d40ba5..ace5cdf 100755 --- a/url.shortme.sh +++ b/url.shortme.sh @@ -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