MCPcopy
hub / github.com/cli/cli / NewCmdList

Function NewCmdList

pkg/cmd/gpg-key/list/list.go:22–43  ·  view source on GitHub ↗
(f *cmdutil.Factory, runF func(*ListOptions) error)

Source from the content-addressed store, hash-verified

20}
21
22func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Command {
23 opts := &ListOptions{
24 IO: f.IOStreams,
25 Config: f.Config,
26 HTTPClient: f.HttpClient,
27 }
28
29 cmd := &cobra.Command{
30 Use: "list",
31 Short: "Lists GPG keys in your GitHub account",
32 Aliases: []string{"ls"},
33 Args: cobra.ExactArgs(0),
34 RunE: func(cmd *cobra.Command, args []string) error {
35 if runF != nil {
36 return runF(opts)
37 }
38 return listRun(opts)
39 },
40 }
41
42 return cmd
43}
44
45func listRun(opts *ListOptions) error {
46 apiClient, err := opts.HTTPClient()

Callers

nothing calls this directly

Calls 1

listRunFunction · 0.70

Tested by

no test coverage detected