summaryrefslogtreecommitdiff
path: root/cmd/planr/sub/common.go
diff options
context:
space:
mode:
authorFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-05 02:41:21 -0500
committerFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-05 02:41:21 -0500
commita6f45bfa932b9e8e2393b5643e2bc38e44ba76df (patch)
treeb823cbca417ea4753f6dfe87ba986d2023ecb39a /cmd/planr/sub/common.go
parent4a6efc74aebcc689a734d05bc8435eb9560340e1 (diff)
downloaddeb-planr-a6f45bfa932b9e8e2393b5643e2bc38e44ba76df.tar.xz
deb-planr-a6f45bfa932b9e8e2393b5643e2bc38e44ba76df.zip
Add config w/ version information
Diffstat (limited to 'cmd/planr/sub/common.go')
-rw-r--r--cmd/planr/sub/common.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/cmd/planr/sub/common.go b/cmd/planr/sub/common.go
new file mode 100644
index 0000000..67d07f8
--- /dev/null
+++ b/cmd/planr/sub/common.go
@@ -0,0 +1,15 @@
+package sub
+
+import (
+ "golang.flu0r1ne.net/planr"
+ "os"
+ "fmt"
+)
+
+func dieIncompatibleVersion(cfg planr.Config) {
+ if cfg.IncompatibleWithVersion() {
+ fmt.Fprintf(os.Stderr, "This version of PlanR (%v) is incompatible with config version %s\n", planr.VERSION, cfg.Version)
+ fmt.Fprintf(os.Stderr, "Please upgrade to version %s or greater\n", cfg.Version)
+ os.Exit(1)
+ }
+}