MCPcopy Create free account
hub / github.com/cli/cli / NewCmdDelete

Function NewCmdDelete

pkg/cmd/repo/deploy-key/delete/delete.go:21–43  ·  view source on GitHub ↗
(f *cmdutil.Factory, runF func(*DeleteOptions) error)

Source from the content-addressed store, hash-verified

19}
20
21func NewCmdDelete(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Command {
22 opts := &DeleteOptions{
23 HTTPClient: f.HttpClient,
24 IO: f.IOStreams,
25 }
26
27 cmd := &cobra.Command{
28 Use: "delete <key-id>",
29 Short: "Delete a deploy key from a GitHub repository",
30 Args: cobra.ExactArgs(1),
31 RunE: func(cmd *cobra.Command, args []string) error {
32 opts.BaseRepo = f.BaseRepo
33 opts.KeyID = args[0]
34
35 if runF != nil {
36 return runF(opts)
37 }
38 return deleteRun(opts)
39 },
40 }
41
42 return cmd
43}
44
45func deleteRun(opts *DeleteOptions) error {
46 httpClient, err := opts.HTTPClient()

Callers

nothing calls this directly

Calls 1

deleteRunFunction · 0.70

Tested by

no test coverage detected