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

Function NewCmdList

pkg/cmd/repo/deploy-key/list/list.go:31–53  ·  view source on GitHub ↗
(f *cmdutil.Factory, runF func(*ListOptions) error)

Source from the content-addressed store, hash-verified

29}
30
31func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Command {
32 opts := &ListOptions{
33 IO: f.IOStreams,
34 HTTPClient: f.HttpClient,
35 }
36
37 cmd := &cobra.Command{
38 Use: "list",
39 Short: "List deploy keys in a GitHub repository",
40 Aliases: []string{"ls"},
41 Args: cobra.ExactArgs(0),
42 RunE: func(cmd *cobra.Command, args []string) error {
43 opts.BaseRepo = f.BaseRepo
44
45 if runF != nil {
46 return runF(opts)
47 }
48 return listRun(opts)
49 },
50 }
51 cmdutil.AddJSONFlags(cmd, &opts.Exporter, deployKeyFields)
52 return cmd
53}
54
55func listRun(opts *ListOptions) error {
56 apiClient, err := opts.HTTPClient()

Callers

nothing calls this directly

Calls 2

AddJSONFlagsFunction · 0.92
listRunFunction · 0.70

Tested by

no test coverage detected