Add sutil CLI in cmd/sutil with internal/cli command tree

This commit is contained in:
2026-10-31 10:03:06 -07:00
parent c9ce5ff442
commit f53b6aad42
7 changed files with 551 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
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
},
}
}