rejectRefWithOtherTarget function

bool rejectRefWithOtherTarget({
  1. required int? ref,
  2. required bool hasOtherTarget,
})

Writes an error and returns true when a ref is combined with another target (a selector or coordinates).

Implementation

bool rejectRefWithOtherTarget({required int? ref, required bool hasOtherTarget}) {
  if (ref == null || !hasOtherTarget) return false;
  stderr.writeln('ERROR: @$ref cannot be combined with --text, --key, --type or coordinates');
  return true;
}