aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-05-20 20:20:20 +0200
committerJoe <rbo@gmx.us>2024-05-20 20:20:20 +0200
commiteb4e06455cc206f7457cb785050f9fbd720919c7 (patch)
treecb28889b472ae5b468eefb4ab7271a303740be1b
parentcli opts letsgo (diff)
downloadhardflip-eb4e06455cc206f7457cb785050f9fbd720919c7.tar.gz
hardflip-eb4e06455cc206f7457cb785050f9fbd720919c7.tar.bz2
hardflip-eb4e06455cc206f7457cb785050f9fbd720919c7.tar.xz
hardflip-eb4e06455cc206f7457cb785050f9fbd720919c7.tar.zst
hardflip-eb4e06455cc206f7457cb785050f9fbd720919c7.zip
even better
-rw-r--r--src/c_hardflip.go11
-rw-r--r--src/c_utils.go13
2 files changed, 14 insertions, 10 deletions
diff --git a/src/c_hardflip.go b/src/c_hardflip.go
index 87979e9..6c67305 100644
--- a/src/c_hardflip.go
+++ b/src/c_hardflip.go
@@ -72,16 +72,7 @@ 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])
- }
+ c_cli_opts(os.Args[1])
}
data_dir := c_get_data_dir(nil)
i_ui(data_dir)
diff --git a/src/c_utils.go b/src/c_utils.go
index af80772..8c79ed3 100644
--- a/src/c_utils.go
+++ b/src/c_utils.go
@@ -258,3 +258,16 @@ func c_not_an_arg(arg string) {
fmt.Println("hf: Unknown argument " + arg)
os.Exit(1)
}
+
+func c_cli_opts(arg string) {
+ switch arg {
+ case "-v",
+ "--version":
+ c_print_version()
+ case "-h",
+ "--help":
+ c_print_help()
+ default:
+ c_not_an_arg(os.Args[1])
+ }
+}