(f factory.Factory)
| 14 | ) |
| 15 | |
| 16 | func NewCmdGet(f factory.Factory) *cobra.Command { |
| 17 | cmd := &cobra.Command{ |
| 18 | Use: "get [key]", |
| 19 | Short: "Gets the value of config key for Octopus CLI", |
| 20 | Long: "Gets the value of config key for Octopus CLI.", |
| 21 | RunE: func(cmd *cobra.Command, args []string) error { |
| 22 | key := "" |
| 23 | if len(args) > 0 { |
| 24 | key = args[0] |
| 25 | } |
| 26 | return getRun(f.IsPromptEnabled(), f.Ask, key, cmd.OutOrStdout()) |
| 27 | |
| 28 | }, |
| 29 | } |
| 30 | return cmd |
| 31 | } |
| 32 | |
| 33 | func getRun(isPromptEnabled bool, ask question.Asker, key string, out io.Writer) error { |
| 34 | if key != "" { |
nothing calls this directly
no test coverage detected