MCPcopy
hub / github.com/cli/cli / NewCmdCredits

Function NewCmdCredits

pkg/cmd/repo/credits/credits.go:33–69  ·  view source on GitHub ↗
(f *cmdutil.Factory, runF func(*CreditsOptions) error)

Source from the content-addressed store, hash-verified

31}
32
33func NewCmdCredits(f *cmdutil.Factory, runF func(*CreditsOptions) error) *cobra.Command {
34 opts := &CreditsOptions{
35 HttpClient: f.HttpClient,
36 IO: f.IOStreams,
37 BaseRepo: f.BaseRepo,
38 Repository: "cli/cli",
39 }
40
41 cmd := &cobra.Command{
42 Use: "credits",
43 Short: "View credits for this tool",
44 Long: `View animated credits for gh, the tool you are currently using :)`,
45 Example: heredoc.Doc(`
46 # See a credits animation for this project
47 $ gh credits
48
49 # Display a non-animated thank you
50 $ gh credits -s
51
52 # Just print the contributors, one per line
53 $ gh credits | cat
54 `),
55 Args: cobra.ExactArgs(0),
56 RunE: func(cmd *cobra.Command, args []string) error {
57 if runF != nil {
58 return runF(opts)
59 }
60
61 return creditsRun(opts)
62 },
63 Hidden: true,
64 }
65
66 cmd.Flags().BoolVarP(&opts.Static, "static", "s", false, "Print a static version of the credits")
67
68 return cmd
69}
70
71func NewCmdRepoCredits(f *cmdutil.Factory, runF func(*CreditsOptions) error) *cobra.Command {
72 opts := &CreditsOptions{

Callers

nothing calls this directly

Calls 1

creditsRunFunction · 0.85

Tested by

no test coverage detected