isCommandName static method

bool isCommandName(
  1. String name
)

Whether a completion can be installed for the command name.

The script is saved in a file named after the command, which is how the shells find it. The name must therefore be the name of the command as a file name, not a path to it: not empty, . or .., and without path separators (/ and \) and control characters.

Implementation

static bool isCommandName(final String name) {
  return name.isNotEmpty &&
      name != '.' &&
      name != '..' &&
      !_notInCommandName.hasMatch(name);
}