public static T ParseArgs <T>(params string[] args) where T : class, new() { var applicationBuilder = new ReflectionAppBuilder <T>(); var context = new DefaultCommandLineContext(NullConsole.Singleton, Directory.GetCurrentDirectory(), args); return((T)applicationBuilder.Bind(context).ParentTarget); }
private static BindResult Bind <TApp>(IConsole console, string[] args) where TApp : class, new() { if (console == null) { throw new ArgumentNullException(nameof(console)); } var applicationBuilder = new ReflectionAppBuilder <TApp>(); return(applicationBuilder.Bind(console, args)); }
private static BindResult Bind <TApp>(CommandLineContext context) where TApp : class, new() { var applicationBuilder = new ReflectionAppBuilder <TApp>(); return(applicationBuilder.Bind(context)); }