github.com/rajasrinivasan/spm@v0.0.0-20200125100127-755649755f3f/src/cmd/install.go (about)

     1  package cmd
     2  
     3  import (
     4  	"../impl"
     5  	"github.com/spf13/cobra"
     6  )
     7  
     8  // installCmd represents the install command
     9  var installCmd = &cobra.Command{
    10  	Use:   "install",
    11  	Short: "Install the package",
    12  	Long: `Install the package provided first verifying the integrity of the artifacts. Argument
    13  	is the package (.spm)`,
    14  	Args: cobra.MinimumNArgs(1),
    15  	Run:  install,
    16  }
    17  
    18  func init() {
    19  	installCmd.PersistentFlags().BoolVar(&impl.ShowOption, "show", false, "extract and show the contents. do not install. Implies --keep")
    20  	rootCmd.AddCommand(installCmd)
    21  }
    22  
    23  func install(cmd *cobra.Command, args []string) {
    24  	impl.Install(args[0])
    25  }