Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit a626b27

Browse files
dmiusDmitry
authored andcommitted
Dynamic subcommands call + help
1 parent da7cc19 commit a626b27

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

nancy.sh

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,39 @@
33
cmd=""
44

55
case "$1" in
6-
run )
7-
cmd="./nancy_run.sh"
8-
shift
9-
;;
10-
workload )
11-
cmd="./nancy_workload.sh"
12-
shift
13-
;;
146
help )
15-
echo "Here will be help! Comming soon."
7+
echo -e "
8+
\033[1mDESCRIPTION\033[22m
9+
10+
The Nancy Command Line Interface is a unified way to manage
11+
database experiments.
12+
13+
Nancy is a member of Postgres.ai's Artificial DBA team
14+
responsible for conducting experiments.
15+
16+
\033[1mSYNOPSYS\033[22m
17+
18+
nancy <command> [parameters]
19+
20+
\033[1mAVAILABLE COMMANDS\033[22m
21+
22+
* help
23+
24+
* prepare-database
25+
26+
* prepare-workload
27+
28+
* run
29+
"
1630
exit 1;
1731
;;
1832
* )
19-
>&2 echo "ERROR: Unknown command."
20-
exit 1;
33+
if [ ! -f "./nancy_$1.sh" ]
34+
then
35+
>&2 echo "ERROR: Unknown command."
36+
exit 1;
37+
fi
38+
cmd="./nancy_$1.sh"
2139
;;
2240
esac
2341

0 commit comments

Comments
 (0)