(f *cmdutil.Factory, runF func(*CreditsOptions) error)
| 31 | } |
| 32 | |
| 33 | func 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 | |
| 71 | func NewCmdRepoCredits(f *cmdutil.Factory, runF func(*CreditsOptions) error) *cobra.Command { |
| 72 | opts := &CreditsOptions{ |
nothing calls this directly
no test coverage detected