diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2022-04-01 21:13:57 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2022-04-01 21:13:57 +0200 |
commit | a3ad64d190692e6b8fa68b7c7a0347860f5ad4bc (patch) | |
tree | 43e07d8f58eed3540ebb5b451c457c99994a0661 /src/p_options.go | |
parent | In progress (diff) | |
download | go2work-a3ad64d190692e6b8fa68b7c7a0347860f5ad4bc.tar.gz go2work-a3ad64d190692e6b8fa68b7c7a0347860f5ad4bc.tar.bz2 go2work-a3ad64d190692e6b8fa68b7c7a0347860f5ad4bc.tar.xz go2work-a3ad64d190692e6b8fa68b7c7a0347860f5ad4bc.tar.zst go2work-a3ad64d190692e6b8fa68b7c7a0347860f5ad4bc.zip |
Its not working for some reason
Diffstat (limited to 'src/p_options.go')
-rw-r--r-- | src/p_options.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/p_options.go b/src/p_options.go index ad35d24..99728d7 100644 --- a/src/p_options.go +++ b/src/p_options.go @@ -39,7 +39,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * go2work: src/p_options.go - * Fri Apr 1 19:44:09 CEST 2022 + * Fri Apr 1 21:13:50 CEST 2022 * Joe * * Options parsing. @@ -48,9 +48,10 @@ package main import ( - "github.com/BurntSushi/toml" + "fmt" "log" "os" + "github.com/BurntSushi/toml" ) func parse_options() Options { @@ -96,6 +97,18 @@ func find_options_file() string { func parse_toml_file(options_file string, def_options Options) Options { options := def_options - toml.DecodeFile(options_file, &options) + fmt.Println(options_file) + _, err := toml.DecodeFile(options_file, &options) + if err != nil { + log.Fatal(err) + } + 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("=======\n") return options } |