NatrixCommand class

Immutable descriptor for a single node in a hierarchical CLI command tree.

NatrixPipeline walks this tree depth-first. It compares every child's id to the next positional argument, descends into the first match, and finally delegates execution to the deepest node reached.

Annotations
  • @immutable

Constructors

NatrixCommand({required String id, String? tooltip, required String description, required NatrixCommandCallback callback, String argumentTip = "", bool inheritFlags = false, bool hidden = false, List<NatrixFlag> flags = const [], List<NatrixCommand> children = const []})
factory

Properties

argumentTip → String
The argumentTip is a word that describes the argument in help requests and briefly explains to the user what they should enter.
final
callback → NatrixCommandCallback
The function executed when this command is selected as the final target of pipeline resolution.
final
children → Iterable<NatrixCommand>
The sub-commands nested directly beneath this command inside pipeline traversal.
final
description → String
A full-length explanation of the command's purpose and behaviour.
final
flags → List<NatrixFlag>
The flags recognised when this command is the execution target.
final
hashCode → int
The hash code for this object.
no setterinherited
hidden → bool
Controls whether this command appears in sub-command listings.
final
id → String
The identifier matched against a positional argument during pipeline traversal.
final
inheritFlags → bool
Determines whether this command inherits its parent's flags.
final
parent → NatrixCommand?
During processing within NatrixPipeline, NatrixCommand will be added as a parent to a new instance, corresponding to its parent NatrixCommand in the CLI tree.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tooltip → String
A concise single-line summary displayed in abbreviated help contexts.
no setter

Methods

hasChildren() → bool
hasParent() → bool
hasTooltip() → bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
withParent([NatrixCommand? parent]) → NatrixCommand
Returns a copy of this command with the provided parent assigned.

Operators

operator ==(Object other) → bool
The equality operator.
inherited