From db5213a116da236ff829ee4fa9a14c20867a852b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 10 Mar 2011 19:59:55 -0500 Subject: Remove the use of positional arguments Positional arguments should be given meaningful names. --- examples/data/scripts/follow.sh | 7 +++++-- examples/data/scripts/formfiller.sh | 1 + examples/data/scripts/load_cookies.sh | 1 + examples/data/scripts/session.sh | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/data/scripts/follow.sh b/examples/data/scripts/follow.sh index 3d0e992..83db395 100755 --- a/examples/data/scripts/follow.sh +++ b/examples/data/scripts/follow.sh @@ -3,14 +3,17 @@ # This script is just a wrapper around follow.js that lets us change uzbl's mode # after a link is selected. +keys="$1" +shift + # if socat is installed then we can change Uzbl's input mode once a link is # selected; otherwise we just select a link. if ! which socat >/dev/null 2>&1; then - echo "script @scripts_dir/follow.js \"@{follow_hint_keys} $1\"" > "$UZBL_FIFO" + echo "script @scripts_dir/follow.js \"@{follow_hint_keys} $keys\"" > "$UZBL_FIFO" exit fi -result="$(echo "script @scripts_dir/follow.js \"@{follow_hint_keys} $1\"" | socat - "unix-connect:$UZBL_SOCKET")" +result="$(echo "script @scripts_dir/follow.js \"@{follow_hint_keys} $keys\"" | socat - "unix-connect:$UZBL_SOCKET")" case $result in *XXXEMIT_FORM_ACTIVEXXX*) # a form element was selected diff --git a/examples/data/scripts/formfiller.sh b/examples/data/scripts/formfiller.sh index 9ce36b4..907ceef 100755 --- a/examples/data/scripts/formfiller.sh +++ b/examples/data/scripts/formfiller.sh @@ -54,6 +54,7 @@ MODELINE="> vim:ft=formfiller" [ -d "$UZBL_FORMS_DIR" ] || mkdir "$UZBL_FORMS_DIR" || exit 1 action="$1" +shift domain="$(echo "$UZBL_URI" | sed -e 's/\(http\|https\):\/\/\([^\/]\+\)\/.*/\2/')" diff --git a/examples/data/scripts/load_cookies.sh b/examples/data/scripts/load_cookies.sh index 65541b4..eff044b 100755 --- a/examples/data/scripts/load_cookies.sh +++ b/examples/data/scripts/load_cookies.sh @@ -2,6 +2,7 @@ if [ -n "$1" ]; then cookie_file="$1" + shift else cookie_file="${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/cookies.txt" fi diff --git a/examples/data/scripts/session.sh b/examples/data/scripts/session.sh index 80c9744..73ee99b 100755 --- a/examples/data/scripts/session.sh +++ b/examples/data/scripts/session.sh @@ -32,6 +32,7 @@ UZBL="uzbl-browser -c \"$UZBL_CONFIG_FILE\"" # add custom flags and whatever her scriptfile="$(readlink -f "$0")" # this script act="$1" +shift if [ -z "$act" ]; then [ -f "$UZBL_SESSION_FILE" ] && act="launch" || act="endsession" -- cgit v1.2.3