aboutsummaryrefslogtreecommitdiffstats
path: root/bib-util
blob: e807b0322fc9942dc7979bbcbc36e4606e870c64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# bib-util - wrapper dispatching to the individual bibutils scripts
#
# usage: bib-util command [args ...]

usage() {
  printf 'usage: bib-util command [args ...]\n' >&2
  printf 'commands: add check convert extract fetch gen key ls\n' >&2
  exit 2
}

[ $# -ge 1 ] || usage
cmd=$1
shift

dir=$(dirname "$0")
case $cmd in
  add|check|convert|extract|fetch|gen|key|ls)
    exec "$dir/bib-$cmd" "$@"
    ;;
  help|-h|--help)
    usage
    ;;
  *)
    printf 'bib-util: unknown command: %s\n' "$cmd" >&2
    usage
    ;;
esac