Boilerplate for all operations
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
|
||||
Copyright © 2022 Brian Buller <brian@bullercodeworks.com>
|
||||
|
||||
*/
|
||||
package cmd
|
||||
@@ -20,21 +20,14 @@ and usage of using your command. For example:
|
||||
Cobra is a CLI library for Go that empowers applications.
|
||||
This application is a tool to generate the needed files
|
||||
to quickly create a Cobra application.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Println("archive called")
|
||||
},
|
||||
RunE: opArchive,
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(archiveCmd)
|
||||
|
||||
// Here you will define your flags and configuration settings.
|
||||
|
||||
// Cobra supports Persistent Flags which will work for this command
|
||||
// and all subcommands, e.g.:
|
||||
// archiveCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||
|
||||
// Cobra supports local flags which will only run when this command
|
||||
// is called directly, e.g.:
|
||||
// archiveCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||
}
|
||||
|
||||
func opArchive(cmd *cobra.Command, args []string) error {
|
||||
fmt.Println("archive called")
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user