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

Function NewCmdList

pkg/cmd/alias/list/list.go:17–40  ·  view source on GitHub ↗
(f *cmdutil.Factory, runF func(*ListOptions) error)

Source from the content-addressed store, hash-verified

15}
16
17func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Command {
18 opts := &ListOptions{
19 IO: f.IOStreams,
20 Config: f.Config,
21 }
22
23 cmd := &cobra.Command{
24 Use: "list",
25 Short: "List your aliases",
26 Aliases: []string{"ls"},
27 Long: heredoc.Doc(`
28 This command prints out all of the aliases gh is configured to use.
29 `),
30 Args: cobra.NoArgs,
31 RunE: func(cmd *cobra.Command, args []string) error {
32 if runF != nil {
33 return runF(opts)
34 }
35 return listRun(opts)
36 },
37 }
38
39 return cmd
40}
41
42func listRun(opts *ListOptions) error {
43 cfg, err := opts.Config()

Callers 1

TestAliasListFunction · 0.70

Calls 1

listRunFunction · 0.70

Tested by 1

TestAliasListFunction · 0.56