[Surfraw-commits] [SCM] surfraw - a fast unix command line interface to WWW branch, master, updated. surfraw_2-2-5_1-62-g6d3f6c3

Ian Beckwith ianb at erislabs.net
Fri Nov 13 05:01:26 UTC 2009


The following commit has been merged in the master branch:
commit 204466d88f0ca5296dfc733babb8d1bf5045f093
Author: Ian Beckwith <ianb at erislabs.net>
Date:   Fri Nov 13 02:29:36 2009 +0000

    netbsd: new option -ps to search ports

diff --git a/ChangeLog b/ChangeLog
index f077a0d..07efb1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
 	* freebsd: new options -psearch=TYPE -psection=SEC
 	  to conduct a search of type TYPE in section SEC of ports.
+	* netbsd: new option -ps to search ports
 
 2009-11-12  Ian Beckwith  <ianb at erislabs.net>
 
diff --git a/elvi/netbsd b/elvi/netbsd
index d7b699f..ba861a4 100755
--- a/elvi/netbsd
+++ b/elvi/netbsd
@@ -6,6 +6,7 @@
 w3_config_hook () {
 defyn   SURFRAW_netbsd_mail	no
 defyn   SURFRAW_netbsd_pr	no
+defyn   SURFRAW_netbsd_ports    no
 }
 
 w3_usage_hook () {
@@ -20,13 +21,16 @@ Local options:
   -pr[=(yes|no)]		Query Problem Reports
   				Default: $SURFRAW_netbsd_pr
   				Environment: SURFRAW_netbsd_pr
+  -ps[=(yes|no)]		Search ports
+  				Default: $SURFRAW_netbsd_ports
+  				Environment: SURFRAW_netbsd_ports
 Examples:
   $w3_argv0 			Teleport to the NetBSD website
   $w3_argv0 mycroft		Search NetBSD website for odeur de mycroft
   $w3_argv0 -mail  		Teleport to the mail-index Query form
   $w3_argv0 -mail proff		Search mailing-list archives for odeur de proff
   $w3_argv0 -pr			Query Problem Report form
-  $w3_argv0 -pr 666		Display PR 666
+  $w3_argv0 -ps surfraw		Search Ports for surfraw
 EOF
     w3_global_usage
 }
@@ -39,6 +43,8 @@ w3_parse_option_hook () {
 	-mail=*) setoptyn	SURFRAW_netbsd_mail		$optarg	;;
 	-pr)	setoptyn	SURFRAW_netbsd_pr		yes	;;
 	-pr=*)	setoptyn	SURFRAW_netbsd_pr		$optarg	;;
+	-ps)	setoptyn	SURFRAW_netbsd_ports		yes	;;
+	-ps=*)	setoptyn	SURFRAW_netbsd_ports		$optarg	;;
 	*) return 1 ;;
     esac
     return 0
@@ -49,6 +55,14 @@ w3_parse_args "$@"
 # w3_args now contains a list of arguments
 test -z "$w3_args" || escaped_args=`w3_url_of_arg $w3_args`
 
+if ok SURFRAW_netbsd_ports; then
+    if test -z "$escaped_args"; then
+        w3_browse_url "http://pkgsrc.se/"
+    else
+        w3_browse_url "http://pkgsrc.se/search.php?so=${escaped_args}"
+    fi
+    exit $?
+fi
 if ok SURFRAW_netbsd_pr; then
     if test -z "$escaped_args"; then
         w3_browse_url "http://www.netbsd.org/Misc/query-pr.html"
diff --git a/test/netbsd.test b/test/netbsd.test
index c31a78e..ec7e322 100644
--- a/test/netbsd.test
+++ b/test/netbsd.test
@@ -4,3 +4,5 @@ netbsd -pr 666
 loose source routing
 netbsd -mail netbsd
 NetBSD
+netbsd -ps surfraw
+Shell Users Revolutionary Front

-- 
surfraw -  a fast unix command line interface to WWW



More information about the Surfraw-commits mailing list