mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-04 11:37:16 +00:00
PT-1534 Adding support for --version argument
This commit is contained in:
@@ -67,6 +67,8 @@ type myDefaults struct {
|
||||
}
|
||||
|
||||
const (
|
||||
TOOLNAME = "pt-secure-collect"
|
||||
|
||||
decryptCmd = "decrypt"
|
||||
encryptCmd = "encrypt"
|
||||
collectCmd = "collect"
|
||||
@@ -81,6 +83,10 @@ var (
|
||||
"pt-summary",
|
||||
"pt-mysql-summary --host=$mysql-host --port=$mysql-port --user=$mysql-user --password=$mysql-pass",
|
||||
}
|
||||
|
||||
Build string = "01-01-1980"
|
||||
GoVersion string = "1.8"
|
||||
Version string = "3.0.1"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -164,12 +170,15 @@ func processCliParams(baseTempPath string, usageWriter io.Writer) (*cliOptions,
|
||||
}
|
||||
msg += "\n "
|
||||
|
||||
app := kingpin.New("pt-secure-collect", msg)
|
||||
app := kingpin.New(TOOLNAME, msg)
|
||||
if usageWriter != nil {
|
||||
app.UsageWriter(usageWriter)
|
||||
app.Terminate(nil)
|
||||
}
|
||||
|
||||
// Add support for --version flag
|
||||
app.Version(TOOLNAME + "\nVersion " + Version + "\nBuild: " + Build + " using " + GoVersion)
|
||||
|
||||
opts := &cliOptions{
|
||||
CollectCommand: app.Command(collectCmd, "Collect, sanitize, pack and encrypt data from pt-tools."),
|
||||
DecryptCommand: app.Command(decryptCmd, "Decrypt an encrypted file. The password will be requested from the terminal."),
|
||||
|
Reference in New Issue
Block a user