Project

General

Profile

« Previous | Next » 

Revision 1553

env_password: Print Usage message if run without initial "."

View differences:

env_password
5 5

  
6 6
set -o pipefail
7 7

  
8
test "${BASH_LINENO[0]}" = 0 && missing_dot=true || missing_dot=false
9
    # whether run without initial "."
10

  
8 11
store=
9 12
test "$1" = - && { store=1; shift;}
10 13

  
11
if ! test "$#" -ge 1; then
14
if $missing_dot || ! test "$#" -ge 1; then
15
    $missing_dot && self="$0"
12 16
    echo "Usage: . $self env_var [desc] (note initial \".\")"|fold -s >&2
13 17
    exit 2
14 18
fi

Also available in: Unified diff