Example #1
0
        void ShowAllUsage()
        {
            CommandUI.PrintHeading("Registered commands");

            foreach (string name in this.CommandNames)
            {
                this.ShowUsage(name);
            }
        }
Example #2
0
        public void RunInteractive()
        {
            CommandUI.PrintHeading(m_appName);

            string input;

            while ((input = CommandUI.GetInput()) != null)
            {
                if (input.Length > 0)
                {
                    this.Run(input);
                }
            }
        }
Example #3
0
 void ShowUsageCommandNotFound(string commandName)
 {
     Console.WriteLine();
     CommandUI.PrintUpperCase("{0}:  No such command.", commandName);
     CommandUI.PrintSectionBreak();
     //
     // Speculatively print out names of commands with this prefix..
     //
     if (this.PrefixMatchCommandNames(commandName).FirstOrDefault() != null)
     {
         //
         // Speculatively print out names of commands with this prefix..
         //
         CommandUI.PrintHeading("Did you mean?");
         this.ListCommands(new string[] { commandName });
     }
     else
     {
         Console.WriteLine(HelpUsage);
     }
 }