aboutsummaryrefslogtreecommitdiffhomepage
path: root/license.go
diff options
context:
space:
mode:
Diffstat (limited to 'license.go')
-rw-r--r--license.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/license.go b/license.go
new file mode 100644
index 00000000..4cbe0128
--- /dev/null
+++ b/license.go
@@ -0,0 +1,26 @@
+package main
+
+import (
+ _ "embed"
+ "flag"
+ "fmt"
+ "os"
+)
+
+var (
+ //go:embed LICENSE
+ license string
+
+ printLicense bool
+)
+
+func init() {
+ flag.BoolVar(&printLicense, "license", false, "Print license")
+}
+
+func tryLicense() {
+ if printLicense {
+ fmt.Println(license)
+ os.Exit(0)
+ }
+}