specifiedActionOptions method

List<ActionOptionMixin> specifiedActionOptions()

Returns the action options of the command that were specified on the command line, if any.

If non-empty, the first one is run instead of the command.

Implementation

List<ActionOptionMixin> specifiedActionOptions() {
  final allArgOptions = [
    ...config.optionsWhereSource(
      (final ValueSourceType s) => s == ValueSourceType.arg,
    ),
    ...builtinConfig.optionsWhereSource(
      (final ValueSourceType s) => s == ValueSourceType.arg,
    ),
  ];
  return allArgOptions
      .map((final o) => o is ActionOptionMixin ? o : o.option)
      .whereType<ActionOptionMixin>()
      .toList();
}