MCPcopy
hub / github.com/cli/cli / setCommonOptions

Method setCommonOptions

pkg/cmd/issue/lock/lock.go:107–130  ·  view source on GitHub ↗
(f *cmdutil.Factory, args []string)

Source from the content-addressed store, hash-verified

105}
106
107func (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
132func NewCmdLock(f *cmdutil.Factory, parentName string, runF func(string, *LockOptions) error) *cobra.Command {
133 opts := &LockOptions{

Callers 2

NewCmdLockFunction · 0.95
NewCmdUnlockFunction · 0.95

Calls 2

ParseIssueFromArgFunction · 0.92
ValueMethod · 0.80

Tested by

no test coverage detected