[Surfraw-commits] [SCM] surfraw - a fast unix command line interface to WWW branch, master, updated. surfraw_2-2-5_1-20-gc46924e
Ian Beckwith
ianb at erislabs.net
Sun Oct 25 15:56:15 UTC 2009
The following commit has been merged in the master branch:
commit ced1acce87634a7fbe2d13e8ccf82f8d89b2c362
Author: James Rowe <jnrowe at gmail.com>
Date: Wed Oct 7 00:52:28 2009 +0100
Support per-user elvi in ~/.surfraw.d.
Based on the idea by Sumant Oemrawsingh.
Signed-off-by: Ian Beckwith <ianb at erislabs.net>
diff --git a/surfraw-bash-completion.IN b/surfraw-bash-completion.IN
index 866d87f..d5d1374 100644
--- a/surfraw-bash-completion.IN
+++ b/surfraw-bash-completion.IN
@@ -11,7 +11,8 @@ _surfraw()
local opts='-browser -elvi -escape-url-args -graphical \
-help -q -quote -quiet -text -version'
local elvi="$(cut -f1 @sysconfdir@/surfraw.bookmarks ~/.surfraw.bookmarks 2>&-
- cd @ELVIDIR@ && echo * 2>&-)"
+ cd @ELVIDIR@ && echo * 2>&-
+ [ -d ~/.surfraw.d ] && cd ~/.surfraw.d && echo * 2>&-)"
if [[ $cur == -* ]]
then COMPREPLY=( $( compgen -W "$opts" -- $cur ) )
# I can't see a way to get the =yes/=no parts to work...
diff --git a/surfraw.1.IN b/surfraw.1.IN
index 8c2cb31..680aeec 100644
--- a/surfraw.1.IN
+++ b/surfraw.1.IN
@@ -309,6 +309,9 @@ Default:
.B @ELVIDIR@
Location of the elvi.
+.TP
+.B ${HOME}/.surfraw.d/
+Per\(hyuser elvi.
.TP
.B @sysconfdir@/surfraw.conf
diff --git a/surfraw.IN b/surfraw.IN
index 880d3e0..22f870c 100644
--- a/surfraw.IN
+++ b/surfraw.IN
@@ -250,7 +250,13 @@ w3_parse_option () {
w3_parse_option_hook "$opt" "$optarg" && return 0
case "$opt" in
-browser=*) setopt SURFRAW_browser $optarg ;;
- -elvi) sed -n 's/^.*elvis: \(.*\)$/\1/p' $elvidir/*; exit 0 ;;
+ -elvi) echo "Global elvi:"
+ sed -n 's/^.*elvis: \(.*\)$/ \1/p' $elvidir/*
+ if [ -d ~/.surfraw.d ]; then
+ echo "Local elvi:"
+ sed -n 's/^.*elvis: \(.*\)$/ \1/p' ~/.surfraw.d/*
+ fi
+ exit 0 ;;
-escape-url-args=*) setoptyn SURFRAW_escape_url_args $optarg ;;
-g | -graphical) setoptyn SURFRAW_graphical yes ;;
-help | --help) do_help=1 ;;
@@ -414,7 +420,10 @@ then
surfraw_usage
exit 0
else
- if [ -x "$elvidir/$elvi" ]
+ if [ -x ~/.surfraw.d/$elvi ]
+ then
+ sh -c "~/.surfraw.d/$elvi $opts $searchterms"
+ elif [ -x "$elvidir/$elvi" ]
then
sh -c "$elvidir/$elvi $opts $searchterms"
else
--
surfraw - a fast unix command line interface to WWW
More information about the Surfraw-commits
mailing list