hidden property

bool hidden

Whether or not this command should be hidden from help listings.

This is intended to be overridden by commands that want to mark themselves hidden.

By default, leaf commands are always visible. Branch commands are visible as long as any of their leaf commands are visible.

Implementation

bool get hidden {
  // Leaf commands are visible by default.
  if (_subcommands.isEmpty) return false;

  // Otherwise, a command is hidden if all of its subcommands are.
  return _subcommands.values.every((subcommand) => subcommand.hidden);
}