bsdman: OpenBSD man page support

master
Pierre Neidhardt 2014-01-18 23:41:55 +01:00
parent 793121ff43
commit e2e466ec55
2 changed files with 14 additions and 2 deletions

View File

@ -1,10 +1,20 @@
#!/bin/sh
if [ "${0##*/}" = "obsdman" ]; then
OS=OpenBSD
DOMAIN="http://www.openbsd.org/cgi-bin"
MANPATH="OpenBSD+Current"
else
OS=FreeBSD
DOMAIN="http://www.freebsd.org/cgi"
MANPATH="FreeBSD+10-current"
fi
if [ $# -eq 0 ] || [ "$1" = "-h" ]; then
cat<<EOF
Usage: ${0##*/} [SECTION] PAGE
Fetch FreeBSD man page PAGE from the official website and display it.
Fetch $OS man page PAGE from the official website and display it.
EOF
exit
@ -23,4 +33,5 @@ if ! command -v curl >/dev/null 2>&1; then
AGENT="wget -q -O - "
fi
$AGENT "http://www.freebsd.org/cgi/man.cgi?query=$PAGE&apropos=0&sektion=$SECTION&manpath=FreeBSD+10-current&arch=default&format=ascii" | less
$AGENT "$DOMAIN/man.cgi?query=$PAGE&apropos=0&sektion=$SECTION&manpath=$MANPATH&arch=default&format=ascii" | less

1
.scripts/obsdman Symbolic link
View File

@ -0,0 +1 @@
bsdman