forked from TrueCloudLab/frostfs-s3-gw
[#578] Unify version output
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
aad4862c59
commit
f5441eb6cb
2 changed files with 7 additions and 2 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
@ -109,12 +110,15 @@ func prepare() (context.Context, *zap.Logger) {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := &cli.App{
|
app := &cli.App{
|
||||||
Name: "NeoFS gate authentication manager",
|
Name: "NeoFS S3 Authmate",
|
||||||
Usage: "Helps manage delegated access via gates to data stored in NeoFS network",
|
Usage: "Helps manage delegated access via gates to data stored in NeoFS network",
|
||||||
Version: version.Version,
|
Version: version.Version,
|
||||||
Flags: appFlags(),
|
Flags: appFlags(),
|
||||||
Commands: appCommands(),
|
Commands: appCommands(),
|
||||||
}
|
}
|
||||||
|
cli.VersionPrinter = func(c *cli.Context) {
|
||||||
|
fmt.Printf("%s\nVersion: %s\nGoVersion: %s\n", c.App.Name, c.App.Version, runtime.Version())
|
||||||
|
}
|
||||||
|
|
||||||
viper.AutomaticEnv()
|
viper.AutomaticEnv()
|
||||||
viper.SetEnvPrefix("AUTHMATE")
|
viper.SetEnvPrefix("AUTHMATE")
|
||||||
|
|
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -259,7 +260,7 @@ func newSettings() *viper.Viper {
|
||||||
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
case versionFlag != nil && *versionFlag:
|
case versionFlag != nil && *versionFlag:
|
||||||
fmt.Printf("NeoFS S3 gateway %s\n", version.Version)
|
fmt.Printf("NeoFS S3 Gateway\nVersion: %s\nGoVersion: %s\n", version.Version, runtime.Version())
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue