MCPcopy Index your code
hub / github.com/cli/cli / NewCmdList

Function NewCmdList

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

listRunFunction · 0.70

Tested by

no test coverage detected