Skip to content

Commit

Permalink
USAGE uses STDERR
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki777 committed May 6, 2023
1 parent 3e21b5b commit c01ae49
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 8 deletions.
12 changes: 11 additions & 1 deletion mongodb/create-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ currentDir="$(
pwd -P
)"
cd $currentDir
./create.sh -f "$format" $1 $2 $3 > /dev/null

if [ $# -eq 0 ]; then
cat <<_EOT_ >&2
usage : $currentDir/create.sh {Name} {MongodbVersion} {Port}
e.g. : $currentDir/create.sh mongo4-foo 4.4.10 27017
e.g. : $currentDir/create.sh mongo5-bar 5.0.3 37017
e.g. : $currentDir/create.sh mongo5-baz 5.0.3 random
_EOT_
exit 1
fi

./create.sh -f "$format" $1 $2 $3 > /dev/null
set -eu
./start.sh -f "$format" $1
2 changes: 1 addition & 1 deletion mongodb/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ currentDir="$(
cd $currentDir

if [ $# -eq 0 ]; then
cat <<_EOT_
cat <<_EOT_ >&2
usage : $currentDir/create.sh {Name} {MongodbVersion} {Port}
e.g. : $currentDir/create.sh mongo4-foo 4.4.10 27017
e.g. : $currentDir/create.sh mongo5-bar 5.0.3 37017
Expand Down
12 changes: 11 additions & 1 deletion mysql/create-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ currentDir="$(
pwd -P
)"
cd $currentDir
./create.sh -f "$format" $1 $2 $3 > /dev/null

if [ $# -eq 0 ]; then
cat <<_EOT_ >&2
usage : $currentDir/create.sh {Name} {MysqlVersion} {Port}
e.g. : $currentDir/create.sh mysql5-foo 5.7.31 13306
e.g. : $currentDir/create.sh mysql8-bar 8.0.30 23306
e.g. : $currentDir/create.sh mysql8-baz 8.0.30 random
_EOT_
exit 1
fi

./create.sh -f "$format" $1 $2 $3 > /dev/null
set -eu
./start.sh -f "$format" $1
2 changes: 1 addition & 1 deletion mysql/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ currentDir="$(
cd $currentDir

if [ $# -eq 0 ]; then
cat <<_EOT_
cat <<_EOT_ >&2
usage : $currentDir/create.sh {Name} {MysqlVersion} {Port}
e.g. : $currentDir/create.sh mysql5-foo 5.7.31 13306
e.g. : $currentDir/create.sh mysql8-bar 8.0.30 23306
Expand Down
13 changes: 12 additions & 1 deletion postgresql/create-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ currentDir="$(
pwd -P
)"
cd $currentDir
./create.sh -f "$format" $1 $2 $3 > /dev/null

if [ $# -eq 0 ]; then
cat <<_EOT_ >&2
usage : $currentDir/create.sh {Name} {PostgresqlVersion} {Port}
e.g. : $currentDir/create.sh pg124-foo 12.4 54321
e.g. : $currentDir/create.sh pg126-bar 12.6 54322
e.g. : $currentDir/create.sh pg132-baz 13.2 54323
e.g. : $currentDir/create.sh pg132-qux 13.2 random
_EOT_
exit 1
fi

./create.sh -f "$format" $1 $2 $3 > /dev/null
set -eu
./start.sh -f "$format" $1
2 changes: 1 addition & 1 deletion postgresql/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ currentDir="$(
cd $currentDir

if [ $# -eq 0 ]; then
cat <<_EOT_
cat <<_EOT_ >&2
usage : $currentDir/create.sh {Name} {PostgresqlVersion} {Port}
e.g. : $currentDir/create.sh pg124-foo 12.4 54321
e.g. : $currentDir/create.sh pg126-bar 12.6 54322
Expand Down
12 changes: 11 additions & 1 deletion redis/create-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ currentDir="$(
pwd -P
)"
cd $currentDir
./create.sh -f "$format" $1 $2 $3 > /dev/null

if [ $# -eq 0 ]; then
cat <<_EOT_ >&2
usage : $currentDir/create.sh {Name} {RedisVersion} {Port}
e.g. : $currentDir/create.sh redis60-bar 6.0.16 26379
e.g. : $currentDir/create.sh redis62-baz 6.2.6 36379
e.g. : $currentDir/create.sh redis62-qux 6.2.6 random
_EOT_
exit 1
fi

./create.sh -f "$format" $1 $2 $3 > /dev/null
set -eu
./start.sh -f "$format" $1
2 changes: 1 addition & 1 deletion redis/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ currentDir="$(
cd $currentDir

if [ $# -eq 0 ]; then
cat <<_EOT_
cat <<_EOT_ >&2
usage : $currentDir/create.sh {Name} {RedisVersion} {Port}
e.g. : $currentDir/create.sh redis60-bar 6.0.16 26379
e.g. : $currentDir/create.sh redis62-baz 6.2.6 36379
Expand Down

0 comments on commit c01ae49

Please sign in to comment.