[Surfraw-commits] [SCM] surfraw - a fast unix command line interface to WWW branch, 2.2.9_release_candidate, updated. surfraw_2-2-5_1-273-g05972cf
Ian Beckwith
ianb at erislabs.net
Sat May 4 13:38:01 UTC 2013
The following commit has been merged in the 2.2.9_release_candidate branch:
commit 05972cfff713130c16f7f545b5135bdd28a03096
Author: Ian Beckwith <ianb at erislabs.net>
Date: Sat May 4 14:37:57 2013 +0100
fixed ctan
diff --git a/ChangeLog b/ChangeLog
index d961763..6bc186a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
* rae: fixed, at least as far as the test passing.
Could really do with some love from someone who
actually speaks spanish.
+ * ctan: fixed search, updated options.
+ Note command-line options have changed.
2013-04-28 Ian Beckwith <ianb at erislabs.net>
diff --git a/elvi/ctan b/elvi/ctan
index 79712ff..52ef65c 100755
--- a/elvi/ctan
+++ b/elvi/ctan
@@ -4,9 +4,10 @@
. surfraw || exit 1
w3_config_hook () {
-defyn SURFRAW_ctan_name 0
-defyn SURFRAW_ctan_desc 0
-defyn SURFRAW_ctan_id 0
+defyn SURFRAW_ctan_topics 0
+defyn SURFRAW_ctan_desc 0
+defyn SURFRAW_ctan_authors 0
+def SURFRAW_ctan_results $SURFRAW_results
}
w3_usage_hook () {
@@ -15,9 +16,9 @@ Usage: $w3_argv0 [options] [search words]...
Description:
Search the Comprehensive TeX Archive Network (ctan.org)
Local options:
- -name Search by filename
-desc Search descriptions (default)
- -id Search package identifiers
+ -topics Search by filename
+ -authors Search package identifiers
Options can be combined to search multiple types at once.
EOF
w3_global_usage
@@ -27,9 +28,9 @@ w3_parse_option_hook () {
opt="$1"
optarg="$2"
case "$opt" in
- -n*) setoptyn SURFRAW_ctan_name 1 ;;
- -d*) setoptyn SURFRAW_ctan_desc 1 ;;
- -i*) setoptyn SURFRAW_ctan_id 1 ;;
+ -top*) setoptyn SURFRAW_ctan_topics 1 ;;
+ -d*) setoptyn SURFRAW_ctan_desc 1 ;;
+ -au*) setoptyn SURFRAW_ctan_authors 1 ;;
*) return 1 ;;
esac
return 0
@@ -42,25 +43,27 @@ if test -z "$w3_args"; then
w3_browse_url "http://www.ctan.org/"
else
escaped_args=`w3_url_of_arg $w3_args`
- if ifno SURFRAW_ctan_name &&
+ if ifno SURFRAW_ctan_topics &&
ifno SURFRAW_ctan_desc &&
- ifno SURFRAW_ctan_id
+ ifno SURFRAW_ctan_authors
then
SURFRAW_ctan_desc=1
fi
- url="http://www.ctan.org/search/?search=${escaped_args}"
- if ifyes SURFRAW_ctan_name
+ url="http://www.ctan.org/search/?x=1&PORTAL=on"
+ url="${url}&phrase=${escaped_args}&max=${SURFRAW_results}"
+
+ if ifyes SURFRAW_ctan_topics
then
- url="${url}&search_type=filename"
+ url="${url}&TOPICS=on"
fi
if ifyes SURFRAW_ctan_desc
then
- url="${url}&search_type=description"
+ url="${url}&PKG=on"
fi
- if ifyes SURFRAW_ctan_id
+ if ifyes SURFRAW_ctan_authors
then
- url="${url}&search_type=id"
+ url="${url}&AUTHORS=on"
fi
w3_browse_url "$url"
diff --git a/test/ctan.test b/test/ctan.test
index 7a2234d..9782a14 100644
--- a/test/ctan.test
+++ b/test/ctan.test
@@ -1,2 +1,2 @@
-ctan -d -i -n texlive
+ctan -d -au -top texlive
texlive-repo
--
surfraw - a fast unix command line interface to WWW
More information about the Surfraw-commits
mailing list