Adding version command.
This commit is contained in:
parent
b2942d3314
commit
112f172c64
2 changed files with 16 additions and 1 deletions
|
@ -2,4 +2,5 @@
|
||||||
|
|
||||||
* Backup and snapshot commands have now been moved to under the force subcommand as these are expensive operations
|
* Backup and snapshot commands have now been moved to under the force subcommand as these are expensive operations
|
||||||
and the subcommand should reflect that.
|
and the subcommand should reflect that.
|
||||||
* Cobra library upgrade.
|
* Cobra library upgrade.
|
||||||
|
* Added version command.
|
14
cmd/root.go
14
cmd/root.go
|
@ -28,6 +28,8 @@ var insecureSkipVerify bool
|
||||||
var caCertsPath string
|
var caCertsPath string
|
||||||
var clientKey, clientCert string
|
var clientKey, clientCert string
|
||||||
|
|
||||||
|
const australisVer = "v0.0.5"
|
||||||
|
|
||||||
var monitorInterval, monitorTimeout int
|
var monitorInterval, monitorTimeout int
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -39,12 +41,24 @@ func init() {
|
||||||
rootCmd.PersistentFlags().StringVarP(&clientCert, "clientCert", "c", "", "Client certificate to use to connect to Aurora.")
|
rootCmd.PersistentFlags().StringVarP(&clientCert, "clientCert", "c", "", "Client certificate to use to connect to Aurora.")
|
||||||
rootCmd.PersistentFlags().StringVarP(&caCertsPath, "caCertsPath", "a", "", "CA certificates path to use.")
|
rootCmd.PersistentFlags().StringVarP(&caCertsPath, "caCertsPath", "a", "", "CA certificates path to use.")
|
||||||
rootCmd.PersistentFlags().BoolVarP(&insecureSkipVerify, "insecureSkipVerify", "i", false, "Skip verification.")
|
rootCmd.PersistentFlags().BoolVarP(&insecureSkipVerify, "insecureSkipVerify", "i", false, "Skip verification.")
|
||||||
|
|
||||||
|
|
||||||
|
// Add version command
|
||||||
|
rootCmd.AddCommand(versionCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Execute() {
|
func Execute() {
|
||||||
rootCmd.Execute()
|
rootCmd.Execute()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var versionCmd = &cobra.Command{
|
||||||
|
Use: "version",
|
||||||
|
Short: "Get version",
|
||||||
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {}, //We don't need a realis client for this cmd
|
||||||
|
PersistentPostRun: func(cmd *cobra.Command, args []string) {}, //We don't need a realis client for this cmd
|
||||||
|
Run: func(cmd *cobra.Command, args []string){ fmt.Println(australisVer) },
|
||||||
|
}
|
||||||
|
|
||||||
func connect(cmd *cobra.Command, args []string) {
|
func connect(cmd *cobra.Command, args []string) {
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue