public void GetCommandsFromAssembly() { ConsoleAutoConfig config = null; ConsoleAuto .Config(null) .LoadCommands(typeof(MyCommandClass).Assembly) .Configure(x => { config = x; }); TestConfig(config); }
public void GetCommandsFromAnnotations() { ConsoleAutoConfig config = null; ConsoleAuto .Config(null) .LoadFromClass(typeof(MyCommandClass)) .Configure(x => { config = x; }); TestConfig(config); }
private static void Main(string[] args) { /* * Examples: * ConsoleAuto.Demo CommandOne -t 33 --test2 false * ConsoleAuto.Demo exec test.yaml * ConsoleAuto.Demo */ ConsoleAuto.Config(args) .LoadCommands() .Run(); //Complex exaple //ConsoleAuto.Config(args) // .LoadCommands() //Load all commands from entry assembly + base commands // .LoadCommands(assembly) //Load from a custom command // .LoadFromType(typeof(MyCommand)) //load a single command // .Register<MyService>() // add a service di di container used in my commands // .Register<IMyService2>(new Service2()) // add a service di di container used in my commands, with a custom implementation // .Configure(config => { // //hack the config here // }) // .Run(); }