Exemple #1
0
        public void Run(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                args = new[] { "-h" };
            }

            //SEE: https://msdn.microsoft.com/en-us/magazine/mt763239.aspx
            var app = new CommandLineApplication(throwOnUnexpectedArg: true)
            {
                FullName         = "\nExcel Converter",
                Description      = "Excel Converter",
                Name             = "ExcelConvert.exe",
                ExtendedHelpText = "\n\nExample:\n\n  ExcelConvert.exe --convert quick-book-balance-sheet --i \"C:\\test-sheet.xlsx\"\n"
            };

            var commandOptions = CommandOptions.ParseAndCreate(app);

            app.HelpOption("-? | -h | --help");

            //execute the commands
            app.OnExecute(async() =>
            {
                return(await ExecuteCommandsAsync(commandOptions));
            });

            app.Execute(args);
        }
Exemple #2
0
        public static AppArgs FromEntity(string[] args)
        {
            var app = new CommandLineApplication()
            {
            };
            var commandOptions = CommandOptions.ParseAndCreate(app);

            app.Execute(args);

            var appArgs = FromEntity(commandOptions);

            return(appArgs);
        }