moveNextFlag method

bool moveNextFlag(
  1. String name, [
  2. String? short
])

Returns the next flag that matches the given name.

If matched, the flag is removed from the command input.

dart run example.dart build --release

In the above example, --release is the next flag.

Implementation

bool moveNextFlag(String name, [String? short]) {
  final index = findNextFlagIndex(name, short);
  if (index == null) return false;

  _internalArguments.removeAtOrNull(index);
  return true;
}