mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-20 10:55:01 +00:00
PT-2236 - pt-secure-collect, pt-pg-summary do not follow PT standard (#652)
* PT-2236 - pt-secure-collect, pt-pg-summary do not follow PT standard for option --version - Redirected UsageWriter to os.Stdout for kingpin, so --version output goes to STDOUT, not to STDERR - Adjusted text, printed by the --version flag - Added test cases to check how --version flag works - Adjusted test cases, so they use TOOLNAME constant * PT-2236 - pt-secure-collect, pt-pg-summary do not follow PT standard for option --version Run go mod tidy as requested by Artem Gavrilov * PT-2236 - pt-secure-collect, pt-pg-summary do not follow PT standard for option --version Renamed const TOOLNAME to toolname to follow Go coding standards
This commit is contained in:
@@ -35,7 +35,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
TOOLNAME = "pt-mongodb-summary"
|
||||
toolname = "pt-mongodb-summary"
|
||||
|
||||
DefaultAuthDB = "admin"
|
||||
DefaultHost = "mongodb://localhost:27017"
|
||||
@@ -194,7 +194,7 @@ func main() {
|
||||
log.SetLevel(logLevel)
|
||||
|
||||
if opts.Version {
|
||||
fmt.Println(TOOLNAME)
|
||||
fmt.Println(toolname)
|
||||
fmt.Printf("Version %s\n", Version)
|
||||
fmt.Printf("Build: %s using %s\n", Build, GoVersion)
|
||||
fmt.Printf("Commit: %s\n", Commit)
|
||||
@@ -202,9 +202,9 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
conf := config.DefaultConfig(TOOLNAME)
|
||||
conf := config.DefaultConfig(toolname)
|
||||
if !conf.GetBool("no-version-check") && !opts.NoVersionCheck {
|
||||
advice, err := versioncheck.CheckUpdates(TOOLNAME, Version)
|
||||
advice, err := versioncheck.CheckUpdates(toolname, Version)
|
||||
if err != nil {
|
||||
log.Infof("cannot check version updates: %s", err.Error())
|
||||
} else if advice != "" {
|
||||
|
Reference in New Issue
Block a user