(cmd *cobra.Command, args []string, toComplete string)
| 13 | ) |
| 14 | |
| 15 | func completeRunExec(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 16 | switch len(args) { |
| 17 | case 0: |
| 18 | return completeAlias(toComplete) |
| 19 | case 1: |
| 20 | return completeMessage(cmd, args, toComplete) |
| 21 | default: |
| 22 | return nil, cobra.ShellCompDirectiveNoFileComp |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | func completeAlias(toComplete string) ([]string, cobra.ShellCompDirective) { |
| 27 | if strings.HasPrefix(toComplete, "/") || strings.HasPrefix(toComplete, ".") { |