plumber

Plumber – a modern approach to plumbing
git clone git://r-36.net/plumber
Log | Files | Refs | README | LICENSE

dictopener (324B)


      1 #!/bin/sh
      2 
      3 if [ $# -lt 1 ];
      4 then
      5 	printf "usage: %s URI\n" "$(basename "$0")" >&2
      6 	exit 1
      7 fi
      8 
      9 uri="$1"
     10 case "$uri" in
     11 dict://*)
     12 	argument="$uri"
     13 	;;
     14 dict:*)
     15 	argument="$(printf "%s\n" "$uri" | cut -d':' -f 2-)"
     16 	;;
     17 *)
     18 	argument="$uri"
     19 	;;
     20 esac
     21 
     22 [ -z "$PAGER" ] && PAGER="less"
     23 $XTERM -e sh -c "dict \"$argument\" | $PAGER"
     24