static int Main()

in SmvInterceptor/SmvInterceptor.cs [32:73]


        static int Main(string[] args)
        {
            Init();

            //Read the XML document for preferences
            XmlDocument doc = OpenXmlFile();

            // Main node for this invocation
            XmlNode binaryNode = null;

            // Read from the XML file, if it's loaded.
            if (doc != null)
            {
                // Get settings node
                XmlNode settingsNode = doc.SelectSingleNode("INTERCEPT/SETTINGS");

                // Print out debug information on startup, if specified
                PrintEnvSpew(args, settingsNode);

                // Figure out if there's a binary name override
                string binaryOverride = RetrieveVariable("binary_override", settingsNode);
                if (binaryOverride != null)
                    binaryName = binaryOverride;

                // Find the reason node within environment or the settings file
                string reasonStr = RetrieveVariable("REASON", settingsNode);
                if (reasonStr != null && reasonStr.Length > 0)
                {
                    // Find the corresponding binary node within the XML for the specific reason
                    XmlNode reasonNode = SelectNode(doc.SelectNodes("INTERCEPT/REASON"), reasonStr);
                    if (reasonNode != null)
                        binaryNode = SelectNode(reasonNode.SelectNodes("BINARY"), binaryName);
                    else
                    {
                        string interceptXmlPath = Path.Combine(interceptDir, Environment.ExpandEnvironmentVariables(interceptXmlFileName));
                        Console.WriteLine("WARNING: Unable to find node for reason={0} in xml file: {1}", reasonStr, interceptXmlPath);
                    }
                }
            }

            return ProcessBinaryNode(binaryNode);
        }