private static async Task <int> RunRootCommandWithMultiCommandsDemo(IServiceProvider servProv, string[] args)
        {
            Console.WriteLine(string.Concat(Enumerable.Repeat(System.Environment.NewLine, 5)));

            IRootCommandBuilder ircb = servProv.GetService <IRootCommandBuilder>();

            if (null == ircb)
            {
                throw new ArgumentNullException("IRootCommandBuilder is null.  Check IoC");
            }

            RootCommand rc          = ircb.CreateRootCommand("my_first_root_command");
            int         returnValue = await rc.InvokeAsync(args);

            Console.WriteLine(string.Format("RootCommand.InvokeAsync='{0}'", returnValue));

            return(returnValue);
        }
Example #2
0
 public Application(IRootCommandBuilder rootCommandBuilder)
 {
     _rootCommandBuilder = rootCommandBuilder;
 }