diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/c_defs.go | 4 | ||||
-rw-r--r-- | src/c_go2work.go | 8 | ||||
-rw-r--r-- | src/p_options.go | 4 |
3 files changed, 8 insertions, 8 deletions
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 } |