From ba7c03e54fb2db498b9c95460c5d67af2b136483 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sat, 21 Aug 2021 20:20:54 -0400 Subject: Remove binary. Add build.sh and LICENSE --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index 9040a70..c0deb6c 100644 --- a/main.go +++ b/main.go @@ -25,6 +25,8 @@ import ( "gopkg.in/yaml.v3" ) +var Version = "Development" + var logger = log.New(os.Stderr, "", 0) var ID_BYTES = 8 @@ -230,8 +232,14 @@ func main() { debug := fl.Bool("d", false, "debugging add information to the logging output DEBUG=true|false controls this as well") storage := fl.String("s", "", "Directory to serve, must be supplied via flag or STORAGE_DIR environment variable") fl.IntVar(&ID_BYTES, "b", ID_BYTES, "How many random bytes for the id?") + version := fl.Bool("v", false, "Print version and exit") + _ = fl.Parse(os.Args[1:]) + if *version { + logger.Fatal(Version) + } + if addr := os.Getenv("LISTEN_ADDR"); addr != "" { *listen = addr } -- cgit v1.2.3