aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/c_defs.go10
-rw-r--r--src/c_go2work.go16
-rw-r--r--src/p_options.go20
-rw-r--r--src/u_utils.go8
4 files changed, 27 insertions, 27 deletions
diff --git a/src/c_defs.go b/src/c_defs.go
index 06aa400..eaeabd0 100644
--- a/src/c_defs.go
+++ b/src/c_defs.go
@@ -76,9 +76,9 @@ func DEF_PLAYER_OPTIONS() []string {
}
type Options struct {
- files []string
- media_player string
- player_options []string
- random bool
- use_fortune bool
+ Files []string
+ Media_player string
+ Player_options []string
+ Random bool
+ Use_fortune bool
}
diff --git a/src/c_go2work.go b/src/c_go2work.go
index 3a58f02..e4f40b5 100644
--- a/src/c_go2work.go
+++ b/src/c_go2work.go
@@ -94,11 +94,11 @@ func main() {
log.Fatalln(LOG_FORMAT)
return
}
- if check_media_player(options.media_player) == false {
- log.Fatal("media player (" + options.media_player + ") not found")
+ 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.Use_fortune == true && check_fortune() == false {
print_fortune_not_found()
}
curr_t = get_time()
@@ -117,21 +117,21 @@ func main() {
var args []string
if file_id > 0 {
args = append(
- options.player_options,
- options.files[file_id],
+ options.Player_options,
+ options.Files[file_id],
)
} else {
args = append(
- options.player_options,
+ options.Player_options,
DEF_FILES()[0],
)
}
has_rang := false
for {
exec_player(
- options.use_fortune,
+ options.Use_fortune,
has_rang,
- options.media_player,
+ options.Media_player,
args...,
)
has_rang = true
diff --git a/src/p_options.go b/src/p_options.go
index 2507bc9..2e03e05 100644
--- a/src/p_options.go
+++ b/src/p_options.go
@@ -66,11 +66,11 @@ func parse_options() Options {
func init_def_options() Options {
options := Options{
- files: DEF_FILES(),
- media_player: DEF_MEDIA_PLAYER,
- player_options: DEF_PLAYER_OPTIONS(),
- random: DEF_RANDOM,
- use_fortune: DEF_USE_FORTUNE,
+ Files: DEF_FILES(),
+ Media_player: DEF_MEDIA_PLAYER,
+ Player_options: DEF_PLAYER_OPTIONS(),
+ Random: DEF_RANDOM,
+ Use_fortune: DEF_USE_FORTUNE,
}
return options
}
@@ -103,11 +103,11 @@ func parse_toml_file(options_file string, def_options Options) Options {
}
fmt.Println("OPTIONS")
fmt.Println("=======")
- fmt.Println(options.files)
- fmt.Println(options.media_player)
- fmt.Println(options.player_options)
- fmt.Println(options.random)
- fmt.Println(options.use_fortune)
+ fmt.Println(options.Files)
+ fmt.Println(options.Media_player)
+ fmt.Println(options.Player_options)
+ fmt.Println(options.Random)
+ fmt.Println(options.Use_fortune)
fmt.Println("=======\n")
return options
}
diff --git a/src/u_utils.go b/src/u_utils.go
index 21d7da7..b93832c 100644
--- a/src/u_utils.go
+++ b/src/u_utils.go
@@ -88,15 +88,15 @@ func get_test_time() [3]byte {
}
func choose_file(options Options) int {
- file_id := len(options.files)
- if options.random == true && file_id > 1 {
+ file_id := len(options.Files)
+ if options.Random == true && file_id > 1 {
rand.Seed(time.Now().UnixNano())
file_id = rand.Intn(file_id)
} else {
file_id = 0
}
- if check_file_exists(options.files[file_id]) == false {
- print_file_not_found(options.files[file_id])
+ if check_file_exists(options.Files[file_id]) == false {
+ print_file_not_found(options.Files[file_id])
return -1
}
return file_id