Ejemplo n.º 1
0
        static async Task <int> Main(string[] args)
        {
            Console.WriteLine("online");
            ConfigHubTests();
            // Test
            var f = new FeatureHardCodedProvider();

            f.AddFeature(new Feature("TEST", true));



            if (Feature.GetFeatureByName("TEST").Active)
            {
            }

            CommandLineArgs        cla  = new CommandLineArgs();
            CommandArgumentSupport clas = new CommandArgumentSupport();

            clas.ProcessArguments(cla, args);
            clas.AddExample("TestConsoleApp.exe -x", "Runs it with an x parameter");
            string sa = clas.GenerateShortHelp(cla, "TestConsoleApp");

            Console.WriteLine("sec");
            Console.WriteLine(sa);

            await HHTestExecute();

            Console.ReadLine();

            return(0);
        }
Ejemplo n.º 2
0
        [Trait(Traits.Style, Traits.Regression)] // Legacy Tests, replace when working on them.
        public void BasicTest_GenerateShortHelp()
        {
            var clas = new CommandArgumentSupport();
            var c2   = new SampleCommandLine_C2();

            string help = clas.GenerateShortHelp(c2, "Tests");

            b.Info.Log("Help: " + help);
            Assert.True(help.Contains("~~MatchShortDescrFilename~~"), "The help message does not contain the short string");
        }
Ejemplo n.º 3
0
        public void TestingKevsUseCase3()
        {
            var tcc  = new Kev_TFS_UseCase();
            var clas = new CommandArgumentSupport();

            string shortHelp = clas.GenerateShortHelp(tcc, "Bugger");

            Assert.True(shortHelp.Contains("Bugger"), "the application name was not present in long help");
            Assert.True(shortHelp.Contains("Pass the build"), "one of the descriptions did not make it into short help");
            Assert.True(shortHelp.Contains("Pass a filename"), "one of the descriptions did not make it into short help");
        }
Ejemplo n.º 4
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Plisky Tool - Online.");

            var clas = new CommandArgumentSupport();

            clas.ArgumentPostfix = "=";
            clas.ProcessArguments(options, args);

            if (!ValidateArgumentSettings(options))
            {
                // TODO : Merge this in with the same code below
                Console.WriteLine("Fatal:  Argument Validation Failed.");
                Console.WriteLine();
                string s = clas.GenerateShortHelp(options, "Plisky Tool");
                Console.WriteLine(s);
                return;
            }

            if ((options.Debug) || (!string.IsNullOrEmpty(options.Trace)))
            {
                Console.WriteLine("Debug Mode, Adding Trace Handler");

                Bilge.AddHandler(new ConsoleHandler(), HandlerAddOptions.SingleType);

                Bilge.SetConfigurationResolver((name, inLevel) => {
                    SourceLevels returnLvl = SourceLevels.Verbose;

                    if ((options.Trace != null) && (options.Trace.ToLowerInvariant() == "info"))
                    {
                        returnLvl = SourceLevels.Information;
                    }

                    if ((name.Contains("Plisky-Versioning")) || (name.Contains("Plisky-Tool")))
                    {
                        return(returnLvl);
                    }
                    return(inLevel);
                });
            }

            Bilge b = new Bilge("Plisky-Tool");

            Bilge.Alert.Online("Plisky-Tool");
            b.Verbose.Dump(options, "App Options");

            if (PerformActionsFromCommandline())
            {
                if (versionerUsed != null)
                {
                    VersioningOutputter vo = new VersioningOutputter(versionerUsed);
                    vo.DoOutput(options.OutputsActive);
                }

                b.Info.Log("All Actions - Complete - Exiting.");
            }
            else
            {
                // TODO : Merge this in with the same code Above
                string s = clas.GenerateShortHelp(options, "Plisky Tool");
                Console.WriteLine(s);
            }

            b.Verbose.Log("Plisky Tool - Exit.");
            b.Flush();
        }