本文整理汇总了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;
}
示例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;
}