aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2022-04-04 16:48:32 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2022-04-04 16:48:32 +0200
commitcd85d6ee15f0cdbf837c4faf340abc398c942877 (patch)
treecd0f66caba4b34cbd8c76ca98b61e961908cc580
parentCaps ffs (diff)
downloadgo2work-cd85d6ee15f0cdbf837c4faf340abc398c942877.tar.gz
go2work-cd85d6ee15f0cdbf837c4faf340abc398c942877.tar.bz2
go2work-cd85d6ee15f0cdbf837c4faf340abc398c942877.tar.xz
go2work-cd85d6ee15f0cdbf837c4faf340abc398c942877.tar.zst
go2work-cd85d6ee15f0cdbf837c4faf340abc398c942877.zip
Test
-rw-r--r--Makefile4
-rw-r--r--src/c_defs.go4
-rw-r--r--src/c_go2work.go8
-rw-r--r--src/p_options.go4
4 files changed, 10 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 03657e4..4ea7221 100644
--- a/Makefile
+++ b/Makefile
@@ -42,10 +42,10 @@ MKDIR = mkdir -p
RMDIR = rmdir
RM = rm -rf
-deps:
- go get github.com/BurntSushi/toml@latest
+# deps:
build:
+ go get github.com/BurntSushi/toml@latest
go build -o ${TARGET} ${SRCS}
clean:
diff --git a/src/c_defs.go b/src/c_defs.go
index eaeabd0..981e07d 100644
--- a/src/c_defs.go
+++ b/src/c_defs.go
@@ -58,7 +58,7 @@ const (
OPTIONS_FILE = PROGNAME + "/" + PROGNAME + ".toml"
DEF_MEDIA_PLAYER = "mpv"
DEF_RANDOM = false
- DEF_USE_FORTUNE = true
+ DEF_FORTUNE = true
)
func DEF_FILES() []string {
@@ -80,5 +80,5 @@ type Options struct {
Media_player string
Player_options []string
Random bool
- Use_fortune bool
+ Fortune bool
}
diff --git a/src/c_go2work.go b/src/c_go2work.go
index e4f40b5..ccd9f86 100644
--- a/src/c_go2work.go
+++ b/src/c_go2work.go
@@ -91,14 +91,14 @@ func main() {
}
options = parse_options()
if check_time_format(dest_t) == false {
- log.Fatalln(LOG_FORMAT)
+ log.Fatal(LOG_FORMAT)
return
}
if check_media_player(options.Media_player) == false {
log.Fatal("media player (" + options.Media_player + ") not found")
return
}
- if options.Use_fortune == true && check_fortune() == false {
+ if options.Fortune == true && check_fortune() == false {
print_fortune_not_found()
}
curr_t = get_time()
@@ -115,7 +115,7 @@ func main() {
curr_t[SECS] == dest_t[SECS] {
file_id := choose_file(options)
var args []string
- if file_id > 0 {
+ if file_id >= 0 {
args = append(
options.Player_options,
options.Files[file_id],
@@ -129,7 +129,7 @@ func main() {
has_rang := false
for {
exec_player(
- options.Use_fortune,
+ options.Fortune,
has_rang,
options.Media_player,
args...,
diff --git a/src/p_options.go b/src/p_options.go
index 2e03e05..e155370 100644
--- a/src/p_options.go
+++ b/src/p_options.go
@@ -70,7 +70,7 @@ func init_def_options() Options {
Media_player: DEF_MEDIA_PLAYER,
Player_options: DEF_PLAYER_OPTIONS(),
Random: DEF_RANDOM,
- Use_fortune: DEF_USE_FORTUNE,
+ Fortune: DEF_FORTUNE,
}
return options
}
@@ -107,7 +107,7 @@ func parse_toml_file(options_file string, def_options Options) Options {
fmt.Println(options.Media_player)
fmt.Println(options.Player_options)
fmt.Println(options.Random)
- fmt.Println(options.Use_fortune)
+ fmt.Println(options.Fortune)
fmt.Println("=======\n")
return options
}