| 113 | } |
| 114 | |
| 115 | func (a *App) deprecatedPromptCommand(name string) *cobra.Command { |
| 116 | msg := "cam prompt was renamed to cam instruction. Use cam instruction --help." |
| 117 | cmd := &cobra.Command{ |
| 118 | Use: name, |
| 119 | Short: msg, |
| 120 | RunE: func(cmd *cobra.Command, args []string) error { |
| 121 | return errors.New(msg) |
| 122 | }, |
| 123 | } |
| 124 | cmd.SetFlagErrorFunc(func(cmd *cobra.Command, err error) error { |
| 125 | return errors.New(msg) |
| 126 | }) |
| 127 | cmd.ValidArgsFunction = func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 128 | return nil, cobra.ShellCompDirectiveNoFileComp |
| 129 | } |
| 130 | return cmd |
| 131 | } |