aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/c_go2work.go11
-rw-r--r--src/u_prints.go10
2 files changed, 11 insertions, 10 deletions
diff --git a/src/c_go2work.go b/src/c_go2work.go
index d7f7e41..2536f01 100644
--- a/src/c_go2work.go
+++ b/src/c_go2work.go
@@ -61,6 +61,7 @@ const (
HOURS = 0
MINS = 1
SECS = 2
+ INTERVAL = 500
)
func main() {
@@ -74,16 +75,16 @@ func main() {
return
}
switch os.Args[1] {
- case "-h":
+ case "-h", "--help":
print_help()
return
- case "-H":
+ case "-H", "--real-help":
print_real_help()
return
- case "-v":
+ case "-v", "--version":
print_version()
return
- case "-t":
+ case "-t", "--test":
dest_t = get_test_time()
default:
str_dest_t := strings.Split(os.Args[1], ":")
@@ -95,7 +96,7 @@ func main() {
}
curr_t = get_time()
print_time_left(curr_t, dest_t)
- ticker := time.NewTicker(500 * time.Millisecond)
+ ticker := time.NewTicker(INTERVAL * time.Millisecond)
quit := make(chan struct{})
for {
select {
diff --git a/src/u_prints.go b/src/u_prints.go
index 64851dd..bcc79d8 100644
--- a/src/u_prints.go
+++ b/src/u_prints.go
@@ -91,14 +91,14 @@ func print_time_left(curr_t [3]byte, dest_t [3]byte) {
}
func print_help() {
- fmt.Println("Usage:
+ fmt.Println(`Usage:
go2work [option / time]
Options:
- -h show this help menu
- -H show the real help menu
- -v show version of go2work
- ")
+ -h, --help show this help menu
+ -H, --real-help show the real help menu
+ -t, --test run a test
+ -v, --version show version of go2work`)
}
func print_real_help() {