Example #1
0
        private void writeArguments()
        {
            var argumentReport = new TwoColumnReport("Arguments");

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

            Flags.Each(x => flagReport.Add(x.ToUsageDescription(), x.Description));
            flagReport.Write();
        }
Example #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();
        }
Example #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();
        }