aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Ben Boeckel <MathStuf@gmail.com>2011-03-10 19:59:55 -0500
committerGravatar Ben Boeckel <MathStuf@gmail.com>2011-03-10 22:32:23 -0500
commitdb5213a116da236ff829ee4fa9a14c20867a852b (patch)
tree9b03c4a6c5d91b94ad244b0d385e74c93a954487 /examples
parent06c29bbd5d1ad0542d8de4a6661bd8366d9c56d5 (diff)
Remove the use of positional arguments
Positional arguments should be given meaningful names.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/data/scripts/follow.sh7
-rwxr-xr-xexamples/data/scripts/formfiller.sh1
-rwxr-xr-xexamples/data/scripts/load_cookies.sh1
-rwxr-xr-xexamples/data/scripts/session.sh1
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"