github.com/rajasrinivasan/spm@v0.0.0-20200125100127-755649755f3f/src/cmd/build.go (about) 1 package cmd 2 3 import ( 4 "../impl" 5 "github.com/spf13/cobra" 6 ) 7 8 // buildCmd represents the build command 9 var buildCmd = &cobra.Command{ 10 Use: "build", 11 Short: "Build a secure package", 12 Long: `Create a secure package based on the configuration file provided. 13 Optionally push the artifact(s) to a distribution server. 14 The first argument is the package spec file (ex spec.yaml) 15 Output package name is the second argument`, 16 Args: cobra.MinimumNArgs(2), 17 Run: build, 18 } 19 20 func init() { 21 rootCmd.AddCommand(buildCmd) 22 } 23 24 func build(cmd *cobra.Command, args []string) { 25 impl.Build(args[0], args[1]) 26 }