Project

General

Profile

« Previous | Next » 

Revision 3406

pg_dump_vegbien: If first arg is "all", dump entire DB. Require a first arg so that Usage message will be displayed if run with no args.

View differences:

bin/pg_dump_vegbien
4 4
selfDir="$(dirname -- "$0")"
5 5

  
6 6
if ! test "$#" -eq 1; then
7
    echo "Usage: env [data=1] [plain=1] [owners=1] $0 [schema] [opts...] >out"\
8
    |fold -s >&2
7
    echo "Usage: env [data=1] [plain=1] [owners=1] $0 {<schema>|all} [opts...] \
8
>out"|fold -s >&2
9 9
    exit 2
10 10
fi
11 11

  
12
if test "${1#-}" = "$1"; then # $1 does not start with "-"
13
    schemaOpt=--schema="\"$1\""
14
    shift
15
    set -- "$schemaOpt" "$@"
16
fi
12
schema="$1"
13
shift
14
test "$schema" != all && set -- --schema="\"$schema\"" "$@"
17 15

  
18 16
if test -n "$data"; then
19 17
    if test -n "$plain"; then set -- "$@" --format=p

Also available in: Unified diff