Add version/commit and -version
This commit is contained in:
parent
71872e02d3
commit
8b1358c8d1
12
cmd/main.go
12
cmd/main.go
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
@ -42,8 +43,17 @@ func main() {
|
||||||
debPath := flag.String("debpath", "debs", "Path to directory containing deb files.")
|
debPath := flag.String("debpath", "debs", "Path to directory containing deb files.")
|
||||||
httpUser := flag.String("httpuser", "debanator", "Username for HTTP basic auth")
|
httpUser := flag.String("httpuser", "debanator", "Username for HTTP basic auth")
|
||||||
httpPass := flag.String("httppass", "", "Enable HTTP basic auth with this password")
|
httpPass := flag.String("httppass", "", "Enable HTTP basic auth with this password")
|
||||||
|
showVersion := flag.Bool("version", false, "Show version")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
log.Info("Starting...")
|
if *showVersion {
|
||||||
|
fmt.Printf("debanator %s, (git#%s)\n", debanator.Version, debanator.Commit)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.WithFields(log.Fields{
|
||||||
|
"version": debanator.Version,
|
||||||
|
"commit": debanator.Commit,
|
||||||
|
}).Info("Starting debanator...")
|
||||||
var ecKey *crypto.Key
|
var ecKey *crypto.Key
|
||||||
kb, err := os.ReadFile("privkey.gpg")
|
kb, err := os.ReadFile("privkey.gpg")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
package debanator
|
||||||
|
|
||||||
|
const Version = "unknown"
|
||||||
|
const Commit = "unknown"
|
Loading…
Reference in New Issue