Exemplo n.º 1
0
 public void Execute(params string[] parameters)
 {
     foreach (var parameter in parameters)
     {
         ICommand cmd = app.FindCommand(parameter);
         Console.WriteLine(line);
         List <string> syns = new List <string>(cmd.Synonyms);
         if (cmd.Name == parameter)
         {
             Console.WriteLine("{0}: {1}", cmd.Name, cmd.Help);
         }
         else
         {
             Console.WriteLine("{0}: {1}", parameter, cmd.Help);
             syns.Remove(parameter);
             syns.Add(cmd.Name);
         }
         if (syns.Count > 0)
         {
             Console.WriteLine("Синонимы: {0}", string.Join(", ", syns));
         }
         if (cmd.Description != string.Empty)
         {
             Console.WriteLine(line1);
             Console.WriteLine(cmd.Description);
         }
     }
     Console.WriteLine(line);
 }
Exemplo n.º 2
0
        public void Execute(params string[] parameters)
        {
            foreach (var a in parameters)
            {
                var cmd = _app.FindCommand(a);
                Console.WriteLine(Line);
                var synonyms = new List <string>(cmd.Synonyms);

                if (cmd.Name == a)
                {
                    Console.WriteLine($"{cmd.Name}: {cmd.Help}");
                }
                else
                {
                    Console.WriteLine($"{a}: {cmd.Help}");
                    synonyms.Remove(a);
                    synonyms.Add(cmd.Name);
                }

                if (synonyms.Count > 0)
                {
                    Console.WriteLine($"Синонимы: {string.Join(", ", synonyms)}");
                }

                if (cmd.Description == string.Empty)
                {
                    continue;
                }

                Console.WriteLine(Line1);
                Console.WriteLine(cmd.Description);
            }

            Console.WriteLine(Line);
        }
Exemplo n.º 3
0
        public void Execute(params string[] parameters)
        {
            foreach (var par in parameters)
            {
                var cmd = app.FindCommand(par);
                Console.WriteLine(Line);
                var name = cmd == app.DefaultCommand
                    ? string.Format("[{0}]", par)
                    : par;

                var syns = new List <string>(cmd.Synonyms);
                if (cmd.Name == par)
                {
                    Console.WriteLine("{0}: {1}", name, cmd.Help);
                }
                else
                {
                    Console.WriteLine("{0}: {1}", name, cmd.Help);
                    syns.Remove(par);
                    syns.Add(cmd.Name);
                }
                if (syns.Count > 0)
                {
                    Console.WriteLine("Синонимы: {0}", string.Join(", ", syns));
                }
                if (cmd.Description == string.Empty)
                {
                    continue;
                }
                Console.WriteLine(Line1);
                Console.WriteLine(cmd.Description);
            }
            Console.WriteLine(Line);
        }
Exemplo n.º 4
0
        public void Execute(params string[] parameters)
        {
            foreach (var parameter in parameters)
            {
                var cmd      = _app.FindCommand(parameter);
                var synonyms = new List <string>(cmd.Synonyms);
                if (cmd.Name == parameter)
                {
                    Console.WriteLine($"{cmd.Name}: {cmd.Help}");
                }
                else
                {
                    Console.WriteLine($"{parameter}: {cmd.Help}");
                    synonyms.Remove(parameter);
                    synonyms.Add(cmd.Name);
                }

                if (synonyms.Count > 0)
                {
                    Console.WriteLine($"Synonyms: {string.Join(", ", synonyms)}");
                }

                if (cmd.Description != string.Empty)
                {
                    Console.WriteLine(cmd.Description);
                }
            }
        }
Exemplo n.º 5
0
 public void Execute(params string[] parameters)
 {
     if (parameters.Length < 1)
     {
         Console.WriteLine(line);
         foreach (ICommand cmd in app.Commands)
         {
             Console.WriteLine($"{cmd.Name}: {cmd.Help}");
         }
         Console.WriteLine(line);
     }
     else
     {
         Console.WriteLine(app.FindCommand(parameters[0]).Description);
     }
 }