Get the URL to be shortened

This commit is contained in:
Jeremy Gardais 2020-03-11 16:36:06 +01:00
parent 36c2314565
commit a9b1c423a4
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 13 additions and 0 deletions

View File

@ -40,4 +40,17 @@ case "$#" in
esac esac
# ]]] # ]]]
# Get URL to be shortened [[[
# Try to get URL from first argument
if [ ${flag_inline} ]; then
url_to_short="${1}"
fi
# Try to get URL from clipboard
if [ "${flag_clipboard}" ]; 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}"
# ]]]
exit 0 exit 0