示例#1
0
        //----------------<Starting Point of the Code Analyzer>----------------------
        public static void Main(string[] args)
        {
            if (args.Length == 0)                      //Validation of input parameters
            {
                Console.WriteLine("Please Enter Path Pattern and Options");
                return;
            }
            string        path     = null;
            List <string> patterns = new List <string>();
            List <string> options;

            CommandLineParsing passArguments = new CommandLineParsing();

            path = passArguments.processArgumentsPath(args);
            if (!Directory.Exists(path))                      //check if path exists
            {
                Console.WriteLine("Please Enter Correct Path");
                return;
            }
            patterns = passArguments.processArgumentsPattern(args);
            options  = passArguments.processArgumentsOptions(args);

            string[] files = Executive.processFiles(path, patterns, options);
            if (files.Length == 0)
            {
                Console.WriteLine("Files not found");
                return;
            }
            Executive.processAnalysis(files, path, patterns, options);
        }
示例#2
0
        //----------------<Starting Point of the Code Analyzer>----------------------
        public static void Main(string[] args)
        {
            if (args.Length == 0)                      //Validation of input parameters
            {
                Console.WriteLine("Please Enter Path Pattern and Options");
                return;
            }
            string path = null;
            List<string> patterns = new List<string>();
            List<string> options;

            CommandLineParsing passArguments = new CommandLineParsing();
            path = passArguments.processArgumentsPath(args);
            if (!Directory.Exists(path))                      //check if path exists
            {
                Console.WriteLine("Please Enter Correct Path");
                return;
            }
            patterns = passArguments.processArgumentsPattern(args);
            options = passArguments.processArgumentsOptions(args);

            string[] files = Executive.processFiles(path, patterns, options);
            if (files.Length == 0)
            {
                Console.WriteLine("Files not found");
                return;
            }
            Executive.processAnalysis(files, path, patterns, options);
        }
        //--------------------< Test Stub for CommandLineParse>-------------------------

#if (TEST_COMMANDLINEPARSING)
        static void Main(string[] args)
        {
            string        path     = null;
            List <string> patterns = new List <string>();
            List <string> options  = new List <string>();

            string[] arg = { "../", "CommandLineParse.cs", "/S" };

            CommandLineParsing passArguments = new CommandLineParsing();

            CommandLineParsing.ShowCommandLine(arg);
            path     = passArguments.processArgumentsPath(arg);
            patterns = passArguments.processArgumentsPattern(arg);
            options  = passArguments.processArgumentsOptions(arg);

            Console.WriteLine("The path is {0}", path);

            foreach (string pattern in patterns)
            {
                Console.WriteLine("The Pattern Provided is {0}", pattern);
            }
            foreach (string option in options)
            {
                Console.WriteLine("The Option Provided is {0}", option);
            }
        }
        static void Main(string[] args)
        {
            string        path     = null;
            List <string> patterns = new List <string>();
            List <string> options  = new List <string>();

            string []          args          = "../../program.*";
            CommandLineParsing passArguments = new CommandLineParsing();

            path     = passArguments.processPath(args);
            patterns = passArguments.processPattern(args);
            options  = passArguments.processOptions(args);
        }
示例#5
0
        //--------------------< Test Stub for CommandLineParse>-------------------------

#if(TEST_COMMANDLINEPARSING)

        static void Main(string[] args)
        {
            string path = null;
            List<string> patterns = new List<string>();
            List<string> options = new List<string>();

            string[] arg = { "../", "CommandLineParse.cs", "/S" };

            CommandLineParsing passArguments = new CommandLineParsing();
            CommandLineParsing.ShowCommandLine(arg);
            path = passArguments.processArgumentsPath(arg);
            patterns = passArguments.processArgumentsPattern(arg);
            options = passArguments.processArgumentsOptions(arg);

            Console.WriteLine("The path is {0}", path);

            foreach (string pattern in patterns)
            {
                Console.WriteLine("The Pattern Provided is {0}", pattern);
            }
            foreach (string option in options)
            {
                Console.WriteLine("The Option Provided is {0}", option);
            }

        }