MCPcopy
hub / github.com/cli/cli / NewCmdUnlock

Function NewCmdUnlock

pkg/cmd/issue/lock/lock.go:180–203  ·  view source on GitHub ↗
(f *cmdutil.Factory, parentName string, runF func(string, *LockOptions) error)

Source from the content-addressed store, hash-verified

178}
179
180func NewCmdUnlock(f *cmdutil.Factory, parentName string, runF func(string, *LockOptions) error) *cobra.Command {
181 opts := &LockOptions{ParentCmd: parentName}
182
183 c := alias[opts.ParentCmd]
184 short := fmt.Sprintf("Unlock %s conversation", strings.ToLower(c.FullName))
185
186 cmd := &cobra.Command{
187 Use: "unlock {<number> | <url>}",
188 Short: short,
189 Args: cobra.ExactArgs(1),
190 RunE: func(cmd *cobra.Command, args []string) error {
191 if err := opts.setCommonOptions(f, args); err != nil {
192 return err
193 }
194
195 if runF != nil {
196 return runF(Unlock, opts)
197 }
198 return lockRun(Unlock, opts)
199 },
200 }
201
202 return cmd
203}
204
205// reason creates a sentence fragment so that the lock reason can be used in a
206// sentence.

Callers 1

Test_NewCmdUnlockFunction · 0.85

Calls 2

setCommonOptionsMethod · 0.95
lockRunFunction · 0.85

Tested by 1

Test_NewCmdUnlockFunction · 0.68