Example #1
0
 public Executive()
 {
     clp = new CommandLineParser();
     fm = new FileMngr();
     analyzer = new Analyzer();
     consoleDisplay = new ConsoleDisplay();
 }
Example #2
0
        static void Main(string[] args)
        {
            string path = null;
            List<string> patterns = new List<string>();
            List<string> options = new List<string>();

            if (args.Length == 0) //arguments null
            {
                Console.Write("\n Sorry! There is no Input");
                Console.Write("\n Please enter Path, Pattern or Option\n\n");
                return;
            }
            CommandLineParser clp = new CommandLineParser();
            path = clp.ProcessCommandlinePath(args);
            patterns = clp.ProcessCommandlinePattern(args);
            options = clp.ProcessCommandlineOption(args);

            if (!Directory.Exists(path)) // given path is invalid
            {
                Console.Write("\n Sorry! ");
                Console.Write("\n path is invalid ...\n\n");
                return;
            }

            string[] files = getFile(path, patterns, options);

            int x = files.Length;
            if (x != 0) // no files at given path
            {
                analysisAndDisplay(args, files, path, patterns, options);
            }
            else
            {
                Display.displayArgument(args, files, path, patterns, options);
                Console.Write("Sorry! There is no File for Your Input\n");
                Console.Write("Enter Correct Input For Analysis\n\n");
            }
        }
Example #3
0
        static void Main(string[] args)
        {
            CommandLineParser clp = new CommandLineParser();
            clp.Args = args;
            Console.WriteLine("Command Line Arguements ");
            foreach (string arg in args)
            {
                Console.Write("  {0}", arg);
            }
            Console.Write("\n");
            if (clp.parseCommandLines())
            {
                Console.WriteLine("\nParsed Command Line Data");
                Console.WriteLine(clp.ToString());
            }
            else
                Console.WriteLine("Nothing to Parse");

            Console.ReadLine();
        }
        static void Main(string[] args)
        {

            Console.Write("\n  Demonstrating CommandLineParser");
            Console.Write("\n ======================\n");

            string[] arg = { "../../", "*.cs", "/s", "/r" };
            CommandLineParser ip = new CommandLineParser();
            string path = ip.ProcessCommandlinePath(arg);
            List<string> patterns = ip.ProcessCommandlinePattern(arg);
            List<string> options = ip.ProcessCommandlineOption(arg);
            ip.ShowCommandLine(arg);

            Console.Write("  Path: {0}\n", path);

            Console.Write("\n  File Pattern: ");
            foreach (string patt in patterns)
                Console.Write("{0}\t", patt);

            Console.Write("\n  Options: ");
            foreach (string patt in options)
                Console.Write("{0}\t", patt);
            Console.WriteLine("\n\n");

        }