Example #1
0
        static int Main(string[] cmdArgs)
        {
            if (cmdArgs.Length != 3)
            {
                //show correct usage
                return(showUsage());
            }

            else
            {
                //we have at least two command line arguments so continue
                if ((cmdArgs[0] == "-f") || (cmdArgs[0] == "-d"))
                {
                    //one of the recognized parameters

                    XMLFileComp fileComp;

                    if (cmdArgs[0] == "-d")
                    {
                        //directory comparision
                        fileComp = new XMLFileComp(cmdArgs[1], cmdArgs[2], true);
                    }

                    else
                    {
                        //file comparision
                        fileComp = new XMLFileComp(cmdArgs[1], cmdArgs[2], false);
                    }

                    if (fileComp.hasFailed)
                    {
                        //test failed
                        return(1);
                    }
                    else
                    {
                        //all tests passed
                        return(0);
                    }
                }

                else
                {
                    //show correct usage
                    return(showUsage());
                }
            }
        }
Example #2
0
        static int Main(string[] cmdArgs)
        {
            if (cmdArgs.Length != 3)
            {
                //show correct usage
                return showUsage();
            }

            else
            {
                //we have at least two command line arguments so continue
                if ((cmdArgs[0] == "-f") || (cmdArgs[0] == "-d"))
                {
                    //one of the recognized parameters

                    XMLFileComp fileComp;

                    if (cmdArgs[0] == "-d")
                    {
                        //directory comparision
                        fileComp = new XMLFileComp(cmdArgs[1], cmdArgs[2], true);
                    }

                    else
                    {
                        //file comparision
                        fileComp = new XMLFileComp(cmdArgs[1], cmdArgs[2], false);
                    }

                    if (fileComp.hasFailed)
                    {
                        //test failed
                        return 1;
                    }
                    else
                    {
                        //all tests passed
                        return 0;
                    }
                }

                else
                {
                    //show correct usage
                    return showUsage();
                }
            }
        }