9d7bbcfa78
This change restructures the overall structure for commands so that all top-level tools are in the cmd/ directory, alongside the primary coco command. This is more "idiomatic Go" in its layout, and makes room for additional command line tools (like cocogo for IDL).
22 lines
467 B
Go
22 lines
467 B
Go
// Copyright 2017 Pulumi, Inc. All rights reserved.
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
const version = "0.0.1" // TODO[pulumi/coconut#13]: a real auto-incrementing version number.
|
|
|
|
func newVersionCmd() *cobra.Command {
|
|
return &cobra.Command{
|
|
Use: "version",
|
|
Short: "Print Coconut's version number",
|
|
Run: runFunc(func(cmd *cobra.Command, args []string) error {
|
|
fmt.Printf("Coconut version %v\n", version)
|
|
return nil
|
|
}),
|
|
}
|
|
}
|