@@ -10,14 +10,15 @@ import (
1010
1111 "github.com/cli/cli/v2/internal/run"
1212 "github.com/cli/cli/v2/internal/text"
13+ "github.com/cli/cli/v2/pkg/cmdutil"
1314 "github.com/cli/cli/v2/pkg/findsh"
1415 "github.com/cli/cli/v2/pkg/iostreams"
1516 "github.com/google/shlex"
1617 "github.com/spf13/cobra"
1718)
1819
1920func NewCmdShellAlias (io * iostreams.IOStreams , aliasName , aliasValue string ) * cobra.Command {
20- return & cobra.Command {
21+ cmd := & cobra.Command {
2122 Use : aliasName ,
2223 Short : fmt .Sprintf ("Shell alias for %q" , text .Truncate (80 , aliasValue )),
2324 RunE : func (c * cobra.Command , args []string ) error {
@@ -39,16 +40,19 @@ func NewCmdShellAlias(io *iostreams.IOStreams, aliasName, aliasValue string) *co
3940 }
4041 return nil
4142 },
42- GroupID : "alias" ,
43- Annotations : map [string ]string {
44- "skipAuthCheck" : "true" ,
45- },
43+ GroupID : "alias" ,
4644 DisableFlagParsing : true ,
4745 }
46+ cmdutil .DisableAuthCheck (cmd )
47+ // Aliases are user-defined names and must not be reported as telemetry
48+ // dimensions, since the name itself may be sensitive (e.g. project or
49+ // organization names).
50+ cmdutil .DisableTelemetry (cmd )
51+ return cmd
4852}
4953
5054func NewCmdAlias (io * iostreams.IOStreams , aliasName , aliasValue string ) * cobra.Command {
51- return & cobra.Command {
55+ cmd := & cobra.Command {
5256 Use : aliasName ,
5357 Short : fmt .Sprintf ("Alias for %q" , text .Truncate (80 , aliasValue )),
5458 RunE : func (c * cobra.Command , args []string ) error {
@@ -60,12 +64,15 @@ func NewCmdAlias(io *iostreams.IOStreams, aliasName, aliasValue string) *cobra.C
6064 root .SetArgs (expandedArgs )
6165 return root .Execute ()
6266 },
63- GroupID : "alias" ,
64- Annotations : map [string ]string {
65- "skipAuthCheck" : "true" ,
66- },
67+ GroupID : "alias" ,
6768 DisableFlagParsing : true ,
6869 }
70+ cmdutil .DisableAuthCheck (cmd )
71+ // Aliases are user-defined names and must not be reported as telemetry
72+ // dimensions, since the name itself may be sensitive (e.g. project or
73+ // organization names).
74+ cmdutil .DisableTelemetry (cmd )
75+ return cmd
6976}
7077
7178// ExpandAlias processes argv to see if it should be rewritten according to a user's aliases.
0 commit comments