Example #1
0
        private void ShowTaskHelp()
        {
            var taskObject = TaskLibrary.GetTaskInstance <ConsoleTask>(TaskName);
            var arguments  = taskObject.GetType().GetTaskArguments().OrderByDescending(arg => arg.IsRequired).ToList();

            Console.WriteLine("\nTask: {0}\n   {1}",
                              taskObject.HelpName,
                              taskObject.HelpDescription);

            Console.Write("\nSyntax:\n   {0} {1}\n",
                          taskObject.HelpName,
                          MemberSyntax(arguments)
                          );

            if (arguments.Any())
            {
                Console.WriteLine("\nParameters:");

                foreach (var arg in arguments)
                {
                    Console.WriteLine(ArgumentSyntax(arg));
                }
            }
            else
            {
                Console.WriteLine("\nNo Parameters");
            }
        }
Example #2
0
        private void ShowGenericHelp()
        {
            Console.WriteLine(UsageText);
            Console.WriteLine("Tasks Available:\n");

            foreach (var task in TaskLibrary.AllTasks)
            {
                if (!task.NoHelp())
                {
                    var taskObject = TaskLibrary.GetTaskInstance <ConsoleTask>(task);
                    Console.WriteLine("  {0}:\n    {1}\n", taskObject.HelpName, taskObject.HelpDescription);
                }
            }
        }