()
| 46 | } |
| 47 | |
| 48 | func init() { |
| 49 | rootCmd.AddCommand(cliCmd) |
| 50 | cliCmd.Flags().StringVarP(&action, "action", "a", "enable", "Enable / Disable a product") |
| 51 | cliCmd.Flags().StringVarP(&productId, "id", "i", "", "Product ID") |
| 52 | cliCmd.Flags().StringVarP(&productName, "product", "n", "", "Product name") |
| 53 | cliCmd.Flags().Float64VarP(&productPrice, "price", "p", 0, "Product price") |
| 54 | |
| 55 | // Here you will define your flags and configuration settings. |
| 56 | |
| 57 | // Cobra supports Persistent Flags which will work for this command |
| 58 | // and all subcommands, e.g.: |
| 59 | // cliCmd.PersistentFlags().String("foo", "", "A help for foo") |
| 60 | |
| 61 | // Cobra supports local flags which will only run when this command |
| 62 | // is called directly, e.g.: |
| 63 | // cliCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") |
| 64 | } |
nothing calls this directly
no outgoing calls
no test coverage detected