예제 #1
0
 /// <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}'");
         }
     }
 }
예제 #2
0
 public void Execute(ICommandContext executionContext)
 {
     executionContext.Error(this.Value);
 }