diff options
-rwxr-xr-x | util/bin/dic | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/util/bin/dic b/util/bin/dic index aceee6e6..b3dac847 100755 --- a/util/bin/dic +++ b/util/bin/dic @@ -4,12 +4,18 @@ # multiple WORDs may be seperated by + like this: multiple+words set -euf -# all three are used by GET -search="$1" -langlang="${2-en}de" -lang="de" - main() { + + case $# in + 1|2) :;; # ok + *) usage; exit 23;; + esac + + # all three are used by GET + search="$1" + langlang="${2-en}de" + lang="de" + GET | simplify | tac } @@ -65,4 +71,8 @@ simplify() { ' } +usage() { + sed -rn '/^# usage:/,/^[^#]/{/^#/{s/# //;p}}' "$0" >&2 +} + main "$@" |