Skip to content

Exercism: NotForExactArgs called with multiple args skips auth for no real subcommand #619

Description

@scottisloud

NotForExactArgs(argsToSkip ...string) matches when in.CommandArgs equals the provided slice exactly — same length, same values, same order. Calling it with four strings at once:

needsauth.NotForExactArgs("completion", "upgrade", "workspace", "troubleshoot"),

only skips auth when the user literally runs exercism completion upgrade workspace troubleshoot — which is not a valid command. Individual subcommands like exercism completion or exercism workspace do not match and will still prompt for authentication unnecessarily.

Fix: call NotForExactArgs once per subcommand:

needsauth.NotForExactArgs("completion"),
needsauth.NotForExactArgs("upgrade"),
needsauth.NotForExactArgs("workspace"),
needsauth.NotForExactArgs("troubleshoot"),

This ensures each subcommand individually bypasses auth, which is the intended behaviour.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions