Skip to content

Commit f8ecc06

Browse files
committed
fix: add initial usage message
Fixes #21
1 parent c812ec8 commit f8ecc06

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@ node_modules/*
2121
bin/node_modules/*
2222

2323
# local testing binaries
24-
kask
24+
kask
25+
26+
# emacs temps
27+
*~

kui/kui.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,25 @@ func Start() {
8080
func (component *KuiComponent) init() {
8181
}
8282

83+
func blue(str string) string {
84+
return fmt.Sprintf("\033[0;34m%s\033[0m", str)
85+
}
86+
func cyan(str string) string {
87+
return fmt.Sprintf("\033[0;36m%s\033[0m", str)
88+
}
89+
func yellow(str string) string {
90+
return fmt.Sprintf("\033[0;33m%s\033[0m", str)
91+
}
92+
8393
func (component *KuiComponent) Run(context Context, args []string) {
8494
component.init()
95+
96+
if len(args) == 1 {
97+
fmt.Printf("Usage: %v\n\n%v\n%v\tUpdate the local UI code\n%v\tPrint the version of the UI code", cyan("kask <command>"), yellow("Commands:"), blue("refresh"), blue("version"))
98+
os.Exit(1)
99+
return
100+
}
101+
85102
refreshRequested := args[1] == "refresh"
86103
context.logger().Debugf("refreshRequested? %v", refreshRequested)
87104

0 commit comments

Comments
 (0)