예제 #1
0
    protected override ConsoleOptions ParseOptions(string /*!*/[] /*!*/ args, ScriptRuntimeSetup /*!*/ runtimeSetup, LanguageSetup /*!*/ languageSetup)
    {
        var rubyOptions = (RubyConsoleOptions)base.ParseOptions(args, runtimeSetup, languageSetup);

        if (rubyOptions == null)
        {
            return(null);
        }

        if (rubyOptions.ChangeDirectory != null)
        {
            Environment.CurrentDirectory = rubyOptions.ChangeDirectory;
        }

        if (rubyOptions.DisplayVersion && (rubyOptions.Command != null || rubyOptions.FileName != null))
        {
            Console.WriteLine(RubyContext.MakeDescriptionString(), Style.Out);
        }

        return(rubyOptions);
    }