From 71a282d7623f8e95463d72aea405644cb1fdbdd2 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 20 May 2024 20:20:20 +0200 Subject: cli opts letsgo --- src/c_hardflip.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/c_hardflip.go') diff --git a/src/c_hardflip.go b/src/c_hardflip.go index dd3dd10..87979e9 100644 --- a/src/c_hardflip.go +++ b/src/c_hardflip.go @@ -51,6 +51,8 @@ package main +import "os" + // the main data structure, holds up everything important type HardData struct { litems *ItemsList @@ -69,6 +71,18 @@ type HardData struct { } func main() { + if len(os.Args) > 1 { + switch os.Args[1] { + case "-v", + "--version": + c_print_version() + case "-h", + "--help": + c_print_help() + default: + c_not_an_arg(os.Args[1]) + } + } data_dir := c_get_data_dir(nil) i_ui(data_dir) } -- cgit v1.2.3