This commit is contained in:
parent
c990e50622
commit
f62519e9cd
23
pkg/cli/templatecmd/ls.go
Normal file
23
pkg/cli/templatecmd/ls.go
Normal file
@ -0,0 +1,23 @@
|
||||
package templatecmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var templates = []string{"docker", "gobin_default"}
|
||||
|
||||
func NewLsCmd() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "ls",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
|
||||
for _, t := range templates {
|
||||
fmt.Printf("%s\n", t)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
@ -7,7 +7,10 @@ func NewTemplateCmd() *cobra.Command {
|
||||
Use: "template",
|
||||
}
|
||||
|
||||
cmd.AddCommand(NewInitCmd())
|
||||
cmd.AddCommand(
|
||||
NewInitCmd(),
|
||||
NewLsCmd(),
|
||||
)
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user