diff --git a/url.shortme.sh b/url.shortme.sh index e9691cf..66acd5c 100755 --- a/url.shortme.sh +++ b/url.shortme.sh @@ -40,4 +40,17 @@ case "$#" in 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