4b103e645e
Example: git-media/0.2.2 (darwin; git 1.9.1; go 1.3)
30 lines
526 B
Go
30 lines
526 B
Go
package commands
|
|
|
|
import (
|
|
"github.com/github/git-media/gitmedia"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
lovesComics bool
|
|
|
|
versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Show the version number",
|
|
Run: versionCommand,
|
|
}
|
|
)
|
|
|
|
func versionCommand(cmd *cobra.Command, args []string) {
|
|
Print(gitmedia.UserAgent)
|
|
|
|
if lovesComics {
|
|
Print("Nothing may see Gah Lak Tus and survive!")
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
versionCmd.Flags().BoolVarP(&lovesComics, "comics", "c", false, "easter egg")
|
|
RootCmd.AddCommand(versionCmd)
|
|
}
|