Esempio n. 1
0
        public static int Main(string[] args)
        {
            var app = new KernelApplication(
                PROPERTIES,
                Init
                );

            return(app.WithDefaultCommands().Execute(args));
        }
Esempio n. 2
0
        public static int Main(string[] args)
        {
            var app = new KernelApplication(
                PROPERTIES,
                Init
                )
                      .ConfigureLogging(loggingBuilder =>
            {
                loggingBuilder.AddFile(
                    Path.Join(Directory.GetCurrentDirectory(), "imoon.log"),
                    minimumLevel: LogLevel.Debug
                    );
            });

            return(app.WithDefaultCommands().Execute(args));
        }
Esempio n. 3
0
        public static int Main(string[] args)
        {
            var app = new KernelApplication(
                PROPERTIES,
                Init
                );
            CommandOption shoutInstallOption = null;

            return(app
                   .AddInstallCommand(
                       installCmd => {
                shoutInstallOption = installCmd.Option(
                    "--shout",
                    "Shout back when echoing input.",
                    CommandOptionType.NoValue
                    );
            }
                       )
                   .AddKernelCommand(
                       kernelCmd => {
                ShoutOption = kernelCmd.Option(
                    "--shout",
                    "Shout back when echoing input.",
                    CommandOptionType.NoValue
                    );
            }
                       )
                   .WithKernelArguments(
                       () => shoutInstallOption.HasValue() ? new[] { "--shout" } : new string[] {}
                       )
                   .WithKernelSpecResources <Program>(
                       new Dictionary <string, string>
            {
                ["logo-64x64.png"] = "echo-kernel.res.logo-64x64.png"
            }
                       )
                   .Execute(args));
        }