public override Task <bool> Execute() { var comm = CommandLoader.CreateCommandExecutor(this.Command, this.Parameters.WithCommand(this.Command), ((ICommand)this).IO); if (comm == null) { if (!string.IsNullOrWhiteSpace(this.Command)) { this.WriteLine(); this.WriteLine(SR.Resource("CommandLine_UnknownCommand", this.Command)); } this.DisplayUserDefaults(); this.ListCommands(); } else { this.WriteLine(); this.WriteCommandLabel(comm.GetType()); this.DisplayUserDefaults(); comm.DisplayHelp(); } return(Task.FromResult(true)); }
public override Task <bool> Execute() { var comm = CommandLoader.CreateCommandExecutor(this.Command, null, this.IO); if (comm == null) { if (!string.IsNullOrWhiteSpace(this.Command)) { this.IO.Writer.WriteLine(); this.IO.Writer.WriteLine(SR.Resource("CommandLine_UnknownCommand", this.Command)); } this.DisplayUserDefaults(); this.ListCommands(); } else { this.DisplayUserDefaults(); } return(Task.FromResult(true)); }
public ICommand CreateCommandExecutor(InputControl io) { string commandValue = this.Command; return(CommandLoader.CreateCommandExecutor(commandValue, this, io)); }