| 25 | } |
| 26 | |
| 27 | func NewCmdStatus(f *cmdutil.Factory, runF func(*StatusOptions) error) *cobra.Command { |
| 28 | opts := &StatusOptions{ |
| 29 | IO: f.IOStreams, |
| 30 | HttpClient: f.HttpClient, |
| 31 | Config: f.Config, |
| 32 | } |
| 33 | |
| 34 | cmd := &cobra.Command{ |
| 35 | Use: "status", |
| 36 | Short: "Show status of relevant issues", |
| 37 | Args: cmdutil.NoArgsQuoteReminder, |
| 38 | RunE: func(cmd *cobra.Command, args []string) error { |
| 39 | // support `-R, --repo` override |
| 40 | opts.BaseRepo = f.BaseRepo |
| 41 | |
| 42 | if runF != nil { |
| 43 | return runF(opts) |
| 44 | } |
| 45 | return statusRun(opts) |
| 46 | }, |
| 47 | } |
| 48 | |
| 49 | cmdutil.AddJSONFlags(cmd, &opts.Exporter, api.IssueFields) |
| 50 | |
| 51 | return cmd |
| 52 | } |
| 53 | |
| 54 | var defaultFields = []string{ |
| 55 | "number", |