Adding version command.

This commit is contained in:
Renan DelValle 2018-10-23 15:24:29 -07:00
parent b2942d3314
commit 112f172c64
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
2 changed files with 16 additions and 1 deletions

View file

@ -2,4 +2,5 @@
* Backup and snapshot commands have now been moved to under the force subcommand as these are expensive operations
and the subcommand should reflect that.
* Cobra library upgrade.
* Cobra library upgrade.
* Added version command.

View file

@ -28,6 +28,8 @@ var insecureSkipVerify bool
var caCertsPath string
var clientKey, clientCert string
const australisVer = "v0.0.5"
var monitorInterval, monitorTimeout int
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(&caCertsPath, "caCertsPath", "a", "", "CA certificates path to use.")
rootCmd.PersistentFlags().BoolVarP(&insecureSkipVerify, "insecureSkipVerify", "i", false, "Skip verification.")
// Add version command
rootCmd.AddCommand(versionCmd)
}
func 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) {
var err error