Esempio n. 1
0
        /// <summary>
        /// Ensures the consistency of the command line options related to the location and format
        /// of the output file, and adjusts the options for ease of use.
        /// </summary>
        /// <param name="options">
        /// A <see cref="SingleFileOptionsBase"/> object containing the command line options.
        /// </param>
        /// <returns>
        /// true if the options are internally consistent; otherwise false.
        /// </returns>
        public static bool Validate(this SingleFileOptionsBase options)
        {
            bool valid = true;

            valid &= options.ValidateOutputLocationOptions();
            valid &= options.ValidateOutputFormatOptions();

            return(valid);
        }
        /// <summary>
        /// Ensures the consistency of the command line options related to the location and format
        /// of the output file, and adjusts the options for ease of use.
        /// </summary>
        /// <param name="options">
        /// A <see cref="SingleFileOptionsBase"/> object containing the command line options.
        /// </param>
        /// <returns>
        /// true if the options are internally consistent; otherwise false.
        /// </returns>
        public static bool Validate(this SingleFileOptionsBase options)
        {
            if (options.SarifOutputVersion == SarifVersion.Unknown)
            {
                //  Parsing the output version failed and the the enum evaluated to 0.
                Console.WriteLine(DriverResources.ErrorInvalidTransformTargetVersion);
                return(false);
            }

            if (!options.ValidateOutputLocationOptions())
            {
                return(false);
            }

            if (!options.ValidateOutputFormatOptions())
            {
                return(false);
            }

            return(true);
        }