diff --git a/url.shortme.sh b/url.shortme.sh index ace5cdf..ecd6818 100755 --- a/url.shortme.sh +++ b/url.shortme.sh @@ -56,4 +56,18 @@ fi # shorten URL result=$(curl -sF"shorten=${url_to_short}" "${null_service_url}") +# Manage the result [[[ +## If the URL should simply be printed to stdout +if [ "${flag_inline}" = "true" ]; then + [ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG − Manage result : Print the result on stdout :" + printf "%b\n" "${result}" +fi +# If the URL should remplace the previous content of the clipboard +if [ "${flag_clipboard}" = "true" ]; then + [ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG − Manage result : Put the result in clipboard." + echo "${result}" | xclip -rmlastnl -selection clipboard +fi + +# ]]] + exit 0