mirror of
https://github.com/bradford-hamilton/apple-1.git
synced 2024-05-31 14:41:29 +00:00
24 lines
538 B
Go
24 lines
538 B
Go
|
package cmd
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"os"
|
||
|
|
||
|
"github.com/spf13/cobra"
|
||
|
)
|
||
|
|
||
|
// versionCmd returns the callers installed appleone version
|
||
|
var versionCmd = &cobra.Command{
|
||
|
Use: "version",
|
||
|
Short: "Retrieve the currently installed appleone version",
|
||
|
Long: "Run `appleone version` to get your current appleone version",
|
||
|
Args: cobra.MinimumNArgs(0),
|
||
|
Run: func(cmd *cobra.Command, args []string) {
|
||
|
if len(args) != 0 {
|
||
|
fmt.Println("The version command does not take any arguments")
|
||
|
os.Exit(1)
|
||
|
}
|
||
|
fmt.Println(currentReleaseVersion)
|
||
|
},
|
||
|
}
|