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.
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:
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.