@@ -34,12 +34,13 @@ const (
3434)
3535
3636type ApiOptions struct {
37- AppVersion string
38- BaseRepo func () (ghrepo.Interface , error )
39- Branch func () (string , error )
40- Config func () (gh.Config , error )
41- HttpClient func () (* http.Client , error )
42- IO * iostreams.IOStreams
37+ AppVersion string
38+ InvokingAgent string
39+ BaseRepo func () (ghrepo.Interface , error )
40+ Branch func () (string , error )
41+ Config func () (gh.Config , error )
42+ HttpClient func () (* http.Client , error )
43+ IO * iostreams.IOStreams
4344
4445 Hostname string
4546 RequestMethod string
@@ -62,11 +63,12 @@ type ApiOptions struct {
6263
6364func NewCmdApi (f * cmdutil.Factory , runF func (* ApiOptions ) error ) * cobra.Command {
6465 opts := ApiOptions {
65- AppVersion : f .AppVersion ,
66- BaseRepo : f .BaseRepo ,
67- Branch : f .Branch ,
68- Config : f .Config ,
69- IO : f .IOStreams ,
66+ AppVersion : f .AppVersion ,
67+ InvokingAgent : f .InvokingAgent ,
68+ BaseRepo : f .BaseRepo ,
69+ Branch : f .Branch ,
70+ Config : f .Config ,
71+ IO : f .IOStreams ,
7072 }
7173
7274 cmd := & cobra.Command {
@@ -385,6 +387,7 @@ func apiRun(opts *ApiOptions) error {
385387 }
386388 opts := api.HTTPClientOptions {
387389 AppVersion : opts .AppVersion ,
390+ InvokingAgent : opts .InvokingAgent ,
388391 CacheTTL : opts .CacheTTL ,
389392 Config : cfg .Authentication (),
390393 EnableCache : opts .CacheTTL > 0 ,
0 commit comments