Command.withArgumentsFrom constructor

Command.withArgumentsFrom(
  1. CommandConstructor cmdBuilder,
  2. Command other
)

"Copy constructor" allows to clone arguments from existing command to new one

Implementation

factory Command.withArgumentsFrom(
    CommandConstructor cmdBuilder, Command other) {
  final cmd = cmdBuilder();
  cmd.arguments = other.arguments;
  cmd.asyncErrorHandler = other.asyncErrorHandler;
  return cmd;
}