@@ -41,19 +41,22 @@ func init() {
4141}
4242
4343var creditsCmd = & cobra.Command {
44- Use : "credits [repository]" ,
45- Short : "View project's credits" ,
46- Long : `View animated credits for this or another project.
47-
48- Examples:
49-
50- gh credits # see a credits animation for this project
44+ Use : "credits" ,
45+ Short : "View credits for this tool" ,
46+ Long : `View animated credits for gh, the tool you are currently using :)` ,
47+ Example : `gh credits # see a credits animation for this project
5148 gh credits owner/repo # see a credits animation for owner/repo
5249 gh credits -s # display a non-animated thank you
5350 gh credits | cat # just print the contributors, one per line
5451` ,
55- Args : cobra .MaximumNArgs (1 ),
56- RunE : credits ,
52+ Args : cobra .ExactArgs (0 ),
53+ RunE : ghCredits ,
54+ Hidden : true ,
55+ }
56+
57+ func ghCredits (cmd * cobra.Command , _ []string ) error {
58+ args := []string {"cli/cli" }
59+ return credits (cmd , args )
5760}
5861
5962func credits (cmd * cobra.Command , args []string ) error {
@@ -64,9 +67,18 @@ func credits(cmd *cobra.Command, args []string) error {
6467 return err
6568 }
6669
67- owner := "cli"
68- repo := "cli"
69- if len (args ) > 0 {
70+ var owner string
71+ var repo string
72+
73+ if len (args ) == 0 {
74+ baseRepo , err := determineBaseRepo (client , cmd , ctx )
75+ if err != nil {
76+ return err
77+ }
78+
79+ owner = baseRepo .RepoOwner ()
80+ repo = baseRepo .RepoName ()
81+ } else {
7082 parts := strings .SplitN (args [0 ], "/" , 2 )
7183 owner = parts [0 ]
7284 repo = parts [1 ]
0 commit comments