Пример #1
0
        protected virtual void OnPrintAlternatives(PrintAlternativesEventArgs e)
        {
            var handler = PrintAlternatives;

            if (handler != null)
            {
                handler(this, e);
            }
            else
            {
                Console.WriteLine("Possible completions:");
                foreach (var item in e.Alternatives)
                {
                    Console.WriteLine($"- {item}");
                }
            }
        }
Пример #2
0
        protected virtual void OnPrintAlternatives(PrintAlternativesEventArgs e)
        {
            var handler = PrintAlternatives;

            if (handler != null)
            {
                handler(this, e);
            }
            else
            {
                if (CompletionPrinter != null)
                {
                    CompletionPrinter(e.Alternatives);
                    CompletionPrinter = DefaultCompletionsPrinter;
                }
                else
                {
                    DefaultCompletionsPrinter(e.Alternatives);
                }
            }
        }
Пример #3
0
 protected virtual void OnPrintAlternatives(PrintAlternativesEventArgs e)
 {
     var handler = PrintAlternatives;
     if (handler != null)
     {
         handler(this, e);
     }
     else
     {
         Console.WriteLine("Possible completions:");
         foreach (var item in e.Alternatives)
         {
             Console.WriteLine($"- {item}");
         }
     }
 }
Пример #4
0
 private static void ShellOnPrintAlternatives(object sender, PrintAlternativesEventArgs e)
 {
     ColorConsole.WriteLine("Possible commands: ".Cyan());
     foreach (var alternative in e.Alternatives)
     {
         ColorConsole.WriteLine("- ", alternative.White());
     }
 }