/// <summary> /// Executes this <see cref="IDangrCommand" />. /// </summary> /// <param name="executionContext"></param> public void Execute(ICommandContext executionContext) { if (this.CommandName == null) { executionContext.Output(executionContext.GetHelpText()); } else { try { executionContext.Output(executionContext.GetHelpText(this.CommandName)); } catch (UnknownCommandException) { executionContext.Error($"Could not find command with name '{this.CommandName}'"); } } }
public void Execute(ICommandContext executionContext) { executionContext.Error(this.Value); }