コード例 #1
0
        public static int Main(string[] args)
        {
            //Check that all the necessary directories exist.
            CPFilePath.CreateDefaultDirectories();

            //Create the CLI parser.
            CLIParser = new CommandLine.Parser(with => with.AutoVersion = false);

            //Based on the given command line flags, execute.
            if (args.Length > 0 && args[0] == "pkg")
            {
                return(CLIParser.ParseArguments <PackageManagerCLIOptions>(args)
                       .MapResult(
                           (PackageManagerCLIOptions opts) => { new Sharpie(opts); return 0; },
                           errs => HandleCLIParseErrors(errs)
                           ));
            }
            else
            {
                return(CommandLine.Parser.Default.ParseArguments <InlineCLIOptions>(args)
                       .MapResult(
                           (InlineCLIOptions opts) => RunAlgoInline(opts, args),
                           errs => HandleCLIParseErrors(errs)
                           ));
            }
        }