MCPcopy Create free account
hub / github.com/compozy/agh / newVersionCommand

Function newVersionCommand

internal/cli/root.go:151–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149}
150
151func newVersionCommand() *cobra.Command {
152 return &cobra.Command{
153 Use: rootVersionKey,
154 Short: "Print the AGH version",
155 RunE: func(cmd *cobra.Command, _ []string) error {
156 return writeCommandOutput(cmd, outputBundle{
157 jsonValue: version.Current(),
158 human: func() (string, error) {
159 return fmt.Sprintf("agh %s", version.Current().Version), nil
160 },
161 toon: func() (string, error) {
162 info := version.Current()
163 return renderToonObject(rootVersionKey, []string{rootVersionKey, "commit", "build_date"}, []string{
164 info.Version,
165 info.Commit,
166 info.BuildDate,
167 }), nil
168 },
169 })
170 },
171 }
172}
173
174func ExecuteContext(ctx context.Context, args []string, stdout io.Writer, stderr io.Writer) int {
175 cmd := NewRootCommand()

Callers 1

newRootCommandFunction · 0.85

Calls 3

CurrentFunction · 0.92
writeCommandOutputFunction · 0.85
renderToonObjectFunction · 0.85

Tested by

no test coverage detected