parseCommand function
Validates the CLI invocation and returns the parsed command name (auth
or iap). Returns null for any other shape — the caller is responsible
for printing a usage hint and exiting with a non-zero status code.
Implementation
String? parseCommand(List<String> args) {
if (args.length != 1) return null;
final cmd = args[0];
if (cmd != 'auth' && cmd != 'iap') return null;
return cmd;
}