Skip to content
This repository was archived by the owner on Apr 21, 2020. It is now read-only.

Commit 62018a1

Browse files
committed
New: Add hello-world devcontrol action
1 parent e148c31 commit 62018a1

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

devcontrol/actions/hello-world.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# @description Hello world
4+
#
5+
# @example
6+
# hello-world
7+
#
8+
# @arg $1 Task: "brief", "help" or "exec"
9+
#
10+
# @exitcode 0
11+
#
12+
# @stdout "Not implemented" message if the requested task is not implemented
13+
#
14+
function hello-world() {
15+
16+
# Init
17+
local briefMessage="Hello world"
18+
local helpMessage="Display 'Hello World' message"
19+
20+
# Task choosing
21+
case $1 in
22+
brief)
23+
showBriefMessage ${FUNCNAME[0]} "$briefMessage"
24+
;;
25+
help)
26+
showHelpMessage ${FUNCNAME[0]} "$helpMessage"
27+
;;
28+
exec)
29+
echo "Hello World!"
30+
;;
31+
*)
32+
showNotImplemtedMessage $1 ${FUNCNAME[0]}
33+
return 1
34+
esac
35+
}
36+
37+
# Main
38+
hello-world "$@"

0 commit comments

Comments
 (0)