package cli import ( "fmt" "github.com/spf13/cobra" ) // newVersionCommand returns `sutil version`, which prints the build // version on its own line. func newVersionCommand(p Params) *cobra.Command { return &cobra.Command{ Use: "version", Short: "Print the sutil version", Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, _ []string) error { _, err := fmt.Fprintln(cmd.OutOrStdout(), p.Version) return err }, } }