getFullCommandMatch method Null safety

  1. @override
String getFullCommandMatch()
inherited

RegEx matching the fully qualified command name with its parents and all aliases

Implementation

@override
String getFullCommandMatch() {
  var parentMatch = "";

  if (parent != null) {
    parentMatch = "${parent!.getFullCommandMatch()} ";
  }

  if (commandNames.isNotEmpty) {
    parentMatch += "(${commandNames.join('|')})";
  }

  return parentMatch.toLowerCase();
}