assertNoPositionalArgsNorArgsAfterSeparator function
void
assertNoPositionalArgsNorArgsAfterSeparator(})
Implementation
void assertNoPositionalArgsNorArgsAfterSeparator(
ArgResults argResults, void Function(String msg) usageException,
{String? commandName, String? usageFooter, bool allowRest = false}) {
if ((argResults.rest.isNotEmpty && !allowRest) ||
hasArgsAfterSeparator(argResults)) {
usageException('${commandName != null ? 'The "$commandName"' : 'This'} '
'command does not support positional args nor args after a separator.'
'${usageFooter != null ? '\n$usageFooter' : ''}');
}
}