Print or send to clipboard the result
This commit is contained in:
parent
32a58d8c83
commit
f9d4d262e0
|
@ -56,4 +56,18 @@ fi
|
||||||
# shorten URL
|
# shorten URL
|
||||||
result=$(curl -sF"shorten=${url_to_short}" "${null_service_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
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue