summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-04-24 21:13:05 +0200
committerxengineering <me@xengineering.eu>2024-04-30 19:52:59 +0200
commit7fd4cc40980c51221af5ca0c3c3cc6ee301632f7 (patch)
tree5705281d60ddd6c800db0dded8607d36cfbab3ca
parentc4a4a8b5f60a568abd2af614ca4a5d06855bc3a1 (diff)
downloadceres-7fd4cc40980c51221af5ca0c3c3cc6ee301632f7.tar
ceres-7fd4cc40980c51221af5ca0c3c3cc6ee301632f7.tar.zst
ceres-7fd4cc40980c51221af5ca0c3c3cc6ee301632f7.zip
Add command line help page
This is expected functionality for a command line application.
-rw-r--r--flags.go17
-rw-r--r--main.go4
2 files changed, 20 insertions, 1 deletions
diff --git a/flags.go b/flags.go
new file mode 100644
index 0000000..2696ce4
--- /dev/null
+++ b/flags.go
@@ -0,0 +1,17 @@
+package main
+
+import (
+ "flag"
+ "fmt"
+)
+
+const help = `Ceres - A recipe server for your home network
+`
+
+func parseFlags() {
+ flag.Usage = func() {
+ fmt.Fprintf(flag.CommandLine.Output(), help)
+ }
+
+ flag.Parse()
+}
diff --git a/main.go b/main.go
index 70a1c00..1071aef 100644
--- a/main.go
+++ b/main.go
@@ -9,14 +9,16 @@ import (
"os/signal"
"syscall"
+ "xengineering.eu/ceres/controller"
"xengineering.eu/ceres/model"
"xengineering.eu/ceres/view"
- "xengineering.eu/ceres/controller"
"github.com/gorilla/mux"
)
func main() {
+ parseFlags()
+
model.InitStorage()
defer model.RemoveStorage()