public string GetUsage()
{
var help = new HelpText("Usage:");
help.AddPreOptionsLine("Ex: SharpMigrations -a MyAssembly.dll -m auto -v 10 -> Migrates to version 10 (no prompt)");
help.AddPreOptionsLine("Ex: SharpMigrations -a MyAssembly.dll -m script -f script.sql -v 10 -> Generates scripts from current version to version 10 into script.sql file");
help.AddPreOptionsLine("Ex: SharpMigrations -a MyAssembly.dll -m script -v 10 -g superplugin -> Generates scripts from current version to version 10 using migration group 'superplugin'");
help.AddPreOptionsLine("Ex: SharpMigrations -a MyAssembly.dll -m seed -s myseed -> Run seed named myseed");
help.AddOptions(this);
return help.ToString();
}
public void Start() { Console.WriteLine("--------------------------------"); Console.WriteLine("Sharp Migrator v" + Assembly.GetExecutingAssembly().GetName().Version); Console.WriteLine("--------------------------------"); PrintPlataform(); _options = new Options(); if (_args.Length == 0 || !Parser.Default.ParseArguments(_args, _options)) { Console.WriteLine(_options.GetUsage()); Exit(); } PrintMigrationGroup(); SetSharpConfig(); PrintDataSource(SharpFactory.Default.ConnectionString); Run(); }