From a9b1c423a4482106b2ab8bdecbb253d80d929d71 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 11 Mar 2020 16:36:06 +0100 Subject: [PATCH] Get the URL to be shortened --- url.shortme.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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