Пример #1
0
        private void CreateOptions()
        {
            CheckPayeesHandler  = Options.Add(new Option(OptionCheckPayees));
            DayBreakHandler     = Options.Add(new Option(OptionDayBreak));
            DownloadHandler     = Options.Add(new Option(OptionDownload));
            DecimalCommaHandler = Options.Add(new Option(OptionDecimalComma, (o, w) => Commodity.Defaults.DecimalCommaByDefault = true));
            TimeColonHandler    = Options.Add(new Option(OptionTimeColon, (o, w) => Commodity.Defaults.TimeColonByDefault = true));
            PriceExpHandler     = Options.Add(new Option(OptionPriceExp)
            {
                Value = "24"
            });
            FileHandler = Options.Add(new FileOption()
            {
                Parent = this
            });
            InputDateFormatHandler = Options.Add(new Option(OptionInputDateFormat, (o, w, s) =>
            {
                // This changes static variables inside times.h, which affects the
                // basic date parser.
                TimesCommon.Current.SetInputDateFormat(s);
            }));
            ExplicitHandler         = Options.Add(new Option(OptionExplicit));
            MasterAccountHandler    = Options.Add(new Option(OptionMasterAccount));
            PedanticHandler         = Options.Add(new Option(OptionPedantic));
            PermissiveHandler       = Options.Add(new Option(OptionPermissive));
            PriceDbHandler          = Options.Add(new Option(OptionPriceDb));
            StrictHandler           = Options.Add(new Option(OptionStrict));
            ValueExprHandler        = Options.Add(new Option(OptionValueExpr));
            RecursiveAliasesHandler = Options.Add(new Option(OptionRecursiveAliases));
            NoAliasesHandler        = Options.Add(new Option(OptionNoAliases));

            Options.AddLookupArgs(OptionDownload, "Q");
            Options.AddLookupArgs(OptionPriceExp, "Z");
            Options.AddLookupOpt(OptionCheckPayees);
            Options.AddLookupOpt(OptionDownload);
            Options.AddLookupOpt(OptionDecimalComma);
            Options.AddLookupOpt(OptionDayBreak);
            Options.AddLookupOpt(OptionExplicit);
            Options.AddLookupOptArgs(OptionFile, "f");
            Options.AddLookupOpt(OptionInputDateFormat);
            Options.AddLookupOptAlt(OptionPriceExp, "leeway_");
            Options.AddLookupOpt(OptionMasterAccount);
            Options.AddLookupOpt(OptionNoAliases);
            Options.AddLookupOpt(OptionPriceDb);
            Options.AddLookupOpt(OptionPriceExp);
            Options.AddLookupOpt(OptionPedantic);
            Options.AddLookupOpt(OptionPermissive);
            Options.AddLookupOpt(OptionRecursiveAliases);
            Options.AddLookupOpt(OptionStrict);
            Options.AddLookupOpt(OptionTimeColon);
            Options.AddLookupOpt(OptionValueExpr);
        }