예제 #1
0
    public static async Task Main(string[] args)
    {
        // There are 4 sample project has a few simple entry programs.

        // The builder API allows you to build an object of type CommandLineApplication
        // and add new commands and settings to it.
        BuilderApi.Main(args);

        // The attribute pattern is more declarative. You can define arguments and options
        // as properties on a type and use attributes to mark how the properties should be treated.
        Attributes.Main(args);

        // This async example shows how to use an async method in your command line application.
        AsyncWithBuilderApi.Main(args);

        // This async example shows how to use an async method with attributes.
        await AsyncWithAttributes.Main(args);
    }
예제 #2
0
    static int Main(string[] args)
    {
        var sample = Prompt.GetInt(@"Which sample?
1 - Attributes
2 - Builder API
> ");

        switch (sample)
        {
        case 1:
            return(AttributeProgram.Main(args));

        case 2:
            return(BuilderApi.Main(args));
        }

        return(1);
    }