wantsHelp method

bool wantsHelp(
  1. List<String> arguments
)

Whether arguments ask for help without the command claiming --help or -h for itself.

Implementation

bool wantsHelp(List<String> arguments) {
  final bool ownsHelp = options.any((o) => o.name == 'help');
  final bool ownsH = options.any((o) => o.abbr == 'h');
  for (final String arg in arguments) {
    if (arg == '--') return false;
    if (arg == '--help' && !ownsHelp) return true;
    if (arg == '-h' && !ownsH) return true;
  }
  return false;
}