AddFlag registers the repeatable --attach flag on cmd.
(cmd *cobra.Command)
| 28 | |
| 29 | // AddFlag registers the repeatable --attach flag on cmd. |
| 30 | func AddFlag(cmd *cobra.Command) *Flag { |
| 31 | f := &Flag{} |
| 32 | // A string slice would split on commas, which are legal in filenames. |
| 33 | cmd.Flags().StringArrayVar(&f.values, flagName, nil, "Attach an image or video `file`, in '<file>#<image alt text>' format") |
| 34 | f.flag = cmd.Flags().Lookup(flagName) |
| 35 | return f |
| 36 | } |
| 37 | |
| 38 | // Changed reports whether the attachment flag was passed. |
| 39 | func (f *Flag) Changed() bool { |
no outgoing calls