Exemplo n.º 1
0
        private void writeArguments()
        {
            var argumentReport = new TwoColumnReport("Arguments");

            Arguments.Each(x => argumentReport.Add(x.MemberName.ToLower(), x.Description));
            argumentReport.Write();
        }
Exemplo n.º 2
0
        private void writeFlags()
        {
            var flagReport = new TwoColumnReport("Flags");

            Flags.Each(x => flagReport.Add(x.ToUsageDescription(), x.Description));
            flagReport.Write();
        }
Exemplo n.º 3
0
        private void writeMultipleUsages(string appName)
        {
            var usageReport = new TwoColumnReport("Usages")
            {
                SecondColumnColor = ConsoleColor.Cyan
            };

            Usages.OrderBy(x => x.Arguments.Count()).ThenBy(x => x.ValidFlags.Count()).Each(u =>
            {
                usageReport.Add(u.Description, u.ToUsage(appName, _commandName));
            });

            usageReport.Write();
        }
Exemplo n.º 4
0
        private void listAllCommands(HelpInput input)
        {
            if (!input.CommandTypes.Any())
            {
                Console.WriteLine("There are no known commands in this executable!");
                return;
            }

            var report = new TwoColumnReport("Available commands:");

            input.CommandTypes.OrderBy(CommandFactory.CommandNameFor).Each(type =>
            {
                report.Add(CommandFactory.CommandNameFor(type), CommandFactory.DescriptionFor(type));
            });

            report.Write();
        }