CommandLine/src/Program.cs
/// <summary>
/// Executes the option specified by the parameter
/// </summary>
/// <param name="option">The actual option (in lowercase)</param>
Executes the option specified by the parameter
Executes the option specified by the parameter
private static void ParseOption(string option) {
            foreach (string opString in OptionsConfiguration.helpOptions)
                if (option.Equals(opString)) {
                    Console.WriteLine(OptionsConfiguration.helpMessage);
                    System.Environment.Exit(0);
                }
            foreach (string opString in OptionsConfiguration.everythigDynamicOptions)
                if (option.Equals(opString)) {
                    DynVarOptions.Instance.EverythingDynamic = true;
                    return;
                }
            foreach (string opString in OptionsConfiguration.everythigStaticOptions)
                if (option.Equals(opString)) {
                    DynVarOptions.Instance.EverythingStatic = true;
                    return;
                }
            foreach (string opString in OptionsConfiguration.runOptions)
                if (option.Equals(opString)) {
                    parameters.Run = true;
                    return;
                }
            foreach (string opString in OptionsConfiguration.noDynamicOptions)
                if (option.Equals(opString))
                {
                    parameters.Dynamic = false;
                    return;
                }
            foreach (string opString in OptionsConfiguration.serverOptions)
                if (option.Equals(opString))
                {
                    parameters.Server = true;
                    return;
                }
            foreach (string opString in OptionsConfiguration.specilizationOptions)
                if (option.Equals(opString))
                {
                    parameters.Specialized = false;
                    return;
                } 
            foreach (string opString in OptionsConfiguration.outputOptions)
                if (option.StartsWith(opString)) {
                    string outFileName = ParseValue(option.Substring(opString.Length, option.Length - opString.Length));
                    parameters.OutputFileName = outFileName;
                    return;
                }
            foreach (string opString in OptionsConfiguration.targetOptions)
                if (option.StartsWith(opString)) {
                    string targetName = ParseValue(option.Substring(opString.Length, option.Length - opString.Length));
                    if (Array.IndexOf(OptionsConfiguration.targetNames, targetName) == -1) {
                        Console.WriteLine(OptionsConfiguration.wrongTarget);
                        System.Environment.Exit(4); 
                    }
                    parameters.TargetPlatform = TargetPlatformRepresentation.Instance.getPlatformFromName(targetName);
                    return;
                }
            Console.Error.WriteLine(OptionsConfiguration.errorMessage);
            System.Environment.Exit(1);  
        }
private static void ParseOption ( string option ) { foreach ( string opString in OptionsConfiguration . helpOptions ) if ( option . Equals ( opString ) ) { Console . WriteLine ( OptionsConfiguration . helpMessage ) ; System . Environment . Exit ( 0 ) ; } foreach ( string opString in OptionsConfiguration . everythigDynamicOptions ) if ( option . Equals ( opString ) ) { DynVarOptions . Instance . EverythingDynamic = true ; return ; } foreach ( string opString in OptionsConfiguration . everythigStaticOptions ) if ( option . Equals ( opString ) ) { DynVarOptions . Instance . EverythingStatic = true ; return ; } foreach ( string opString in OptionsConfiguration . runOptions ) if ( option . Equals ( opString ) ) { parameters . Run = true ; return ; } foreach ( string opString in OptionsConfiguration . noDynamicOptions ) if ( option . Equals ( opString ) ) { parameters . Dynamic = false ; return ; } foreach ( string opString in OptionsConfiguration . serverOptions ) if ( option . Equals ( opString ) ) { parameters . Server = true ; return ; } foreach ( string opString in OptionsConfiguration . specilizationOptions ) if ( option . Equals ( opString ) ) { parameters . Specialized = false ; return ; } foreach ( string opString in OptionsConfiguration . outputOptions ) if ( option . StartsWith ( opString ) ) { string outFileName = ParseValue ( option . Substring ( opString . Length , option . Length - opString . Length ) ) ; parameters . OutputFileName = outFileName ; return ; } foreach ( string opString in OptionsConfiguration . targetOptions ) if ( option . StartsWith ( opString ) ) { string targetName = ParseValue ( option . Substring ( opString . Length , option . Length - opString . Length ) ) ; if ( Array . IndexOf ( OptionsConfiguration . targetNames , targetName ) == - 1 ) { Console . WriteLine ( OptionsConfiguration . wrongTarget ) ; System . Environment . Exit ( 4 ) ; } parameters . TargetPlatform = TargetPlatformRepresentation . Instance . getPlatformFromName ( targetName ) ; return ; } Console . Error . WriteLine ( OptionsConfiguration . errorMessage ) ; System . Environment . Exit ( 1 ) ; }
Executes the option specified by the parameter
Executes the option specified by the parameter
// * Help option // * Help requested // * Everything dynamic option // * Everything static option // * Run option // * Nodynamic option // * Server option // * Specialized option             // * Out option // * Target option // 4 == Bad target // * If the method has not returned, an error exists // 1 == Unknown option
option
string
The actual option (in lowercase)
The actual option ( in lowercase )