当前位置: 首页>>代码示例>>C#>>正文


C# CommandParser.Argument方法代码示例

本文整理汇总了C#中CommandParser.Argument方法的典型用法代码示例。如果您正苦于以下问题:C# CommandParser.Argument方法的具体用法?C# CommandParser.Argument怎么用?C# CommandParser.Argument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CommandParser的用法示例。


在下文中一共展示了CommandParser.Argument方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateCustomOpts

        public override CommandParser CreateCustomOpts(CommandParser cli)
        {
            cli.Argument("u", "username", "a valid MySQL username (required)", "database-username",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("username", v));

            cli.Argument("c", "command", "Path to mysql if not in environment path", "command",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("command", v));

            cli.Argument("d", "database", "MySQL database (required)", "database",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("database", v));

            return cli;
        }
开发者ID:prunkster,项目名称:db-migrator-net,代码行数:13,代码来源:Parser.cs

示例2: CreateDefaultOpts

        private CommandParser CreateDefaultOpts(CommandParser cli)
        {
            cli.Argument("u", "username", "database username", "database-username",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("username", v));

            cli.Argument("p", "password", "database password", "database-password",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("password", v));

            cli.Argument("c", "command", "Path to osql if not in environment path", "command",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("command", v));

            cli.Argument("h", "host", "Host", "database-host", CommandArgumentFlags.TakesParameter,
                         (p, v) => Options.Add("host", v));

            cli.Argument("d", "database", "database - can be left if default database for user is set", "database",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("database", v));

            cli.Argument("a", "args", "Additional arguments which will added to osql command", "args",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("args", v));

            cli.Argument("S", "suffix",
                         "Use only files with this suffix as migration scripts and ignore other resources (default: .sql)",
                         "migration-suffix",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("suffix", v));

            cli.Argument("s", "strategy",
                         "can be \"flat\" or \"hierarchial\". flat means, that all scripts must be available inside this directory in form of yyyymmdd[-|_]<migration-number>-<name>.suffix. \"hierarchial\" means a directory structure in form of <major>\\<minor>\\<migration-number>[-|_]<name>.suffix",
                         "migration-strategy",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("strategy", v));

            cli.Argument("i", "ini", "an .ini file from which to read all relevant settings",
                         "INI configuration file", CommandArgumentFlags.TakesParameter,
                         (p, v) => Options.Add("ini", v));

            cli.Argument("x", "section", "name of the section in which to look for", "INI section name",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("section", v));

            cli.Argument("?", "help", "Help", "Help", CommandArgumentFlags.None, (p, v) => { _showHelp = true; });

            return cli;
        }
开发者ID:prunkster,项目名称:db-migrator-net,代码行数:41,代码来源:AbstractParser.cs


注:本文中的CommandParser.Argument方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。