aboutsummaryrefslogtreecommitdiff
path: root/client/main.go
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2021-08-21 20:20:54 -0400
committerMitchell Riedstra <mitch@riedstra.dev>2021-08-21 20:20:54 -0400
commitba7c03e54fb2db498b9c95460c5d67af2b136483 (patch)
tree6697da48bfcca1ef418fdefcfdc273a7cd3c8d9a /client/main.go
parent5f0ea81f90fbfd3d0b91a48a2ad4f97be06d8441 (diff)
downloadpaste-ba7c03e54fb2db498b9c95460c5d67af2b136483.tar.gz
paste-ba7c03e54fb2db498b9c95460c5d67af2b136483.tar.xz
Remove binary. Add build.sh and LICENSE
Diffstat (limited to 'client/main.go')
-rw-r--r--client/main.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/client/main.go b/client/main.go
index 279c88d..d322e84 100644
--- a/client/main.go
+++ b/client/main.go
@@ -14,6 +14,8 @@ import (
"gopkg.in/yaml.v3"
)
+var Version = "Development"
+
var ConfigFn = filepath.Join(os.Getenv("HOME"), ".paste")
var TokenFN = filepath.Join(os.Getenv("HOME"), ".paste-token")
@@ -167,9 +169,14 @@ func main() {
fl.StringVar(&ConfigFn, "c", ConfigFn, "Configuration file")
title := fl.String("t", "", "Optional title for the message")
debug := fl.Bool("d", false, "debugging add information to the logging output DEBUG=true|false controls this as well")
+ version := fl.Bool("v", false, "Print version and exit")
_ = fl.Parse(os.Args[1:])
+ if *version {
+ logger.Fatal(Version)
+ }
+
if d := os.Getenv("DEBUG"); d == "true" || *debug {
logger.SetFlags(log.LstdFlags | log.Llongfile)
}