(f *cmdutil.Factory, args []string)
| 105 | } |
| 106 | |
| 107 | func (opts *LockOptions) setCommonOptions(f *cmdutil.Factory, args []string) error { |
| 108 | opts.IO = f.IOStreams |
| 109 | opts.HttpClient = f.HttpClient |
| 110 | opts.Config = f.Config |
| 111 | |
| 112 | issueNumber, baseRepo, err := shared.ParseIssueFromArg(args[0]) |
| 113 | if err != nil { |
| 114 | return err |
| 115 | } |
| 116 | |
| 117 | // If the args provided the base repo then use that directly. |
| 118 | if baseRepo, present := baseRepo.Value(); present { |
| 119 | opts.BaseRepo = func() (ghrepo.Interface, error) { |
| 120 | return baseRepo, nil |
| 121 | } |
| 122 | } else { |
| 123 | // support `-R, --repo` override |
| 124 | opts.BaseRepo = f.BaseRepo |
| 125 | } |
| 126 | |
| 127 | opts.IssueNumber = issueNumber |
| 128 | |
| 129 | return nil |
| 130 | } |
| 131 | |
| 132 | func NewCmdLock(f *cmdutil.Factory, parentName string, runF func(string, *LockOptions) error) *cobra.Command { |
| 133 | opts := &LockOptions{ |
no test coverage detected