Skip to content

Commit b686a15

Browse files
committed
Fix comment
1 parent 2a3c782 commit b686a15

1 file changed

Lines changed: 1 addition & 24 deletions

File tree

plugins/copilot/copilot.go

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,11 @@ func CopilotCLI() schema.Executable {
1212
Name: "GitHub Copilot CLI",
1313
Runs: []string{"copilot"},
1414
DocsURL: sdk.URL("https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference"),
15-
NeedsAuth: copilotNeedsAuth(),
15+
NeedsAuth: needsauth.NotForHelpOrVersion(),
1616
Uses: []schema.CredentialUsage{
1717
{
1818
Name: credname.AuthToken,
1919
},
2020
},
2121
}
2222
}
23-
24-
func copilotNeedsAuth() sdk.NeedsAuthentication {
25-
return needsauth.IfAll(
26-
needsauth.NotForExactArgs("-h"),
27-
needsauth.NotForExactArgs("--help"),
28-
needsauth.NotForExactArgs("-help"),
29-
needsauth.NotForExactArgs("-v"),
30-
needsauth.NotForExactArgs("--version"),
31-
needsauth.NotForExactArgs("-version"),
32-
needsauth.NotForExactArgs("-V"),
33-
notForFirstArg("help"),
34-
notForFirstArg("version"),
35-
notForFirstArg("completion"),
36-
notForFirstArg("login"),
37-
notForFirstArg("logout"),
38-
)
39-
}
40-
41-
func notForFirstArg(arg string) sdk.NeedsAuthentication {
42-
return func(in sdk.NeedsAuthenticationInput) bool {
43-
return len(in.CommandArgs) == 0 || in.CommandArgs[0] != arg
44-
}
45-
}

0 commit comments

Comments
 (0)