Cysharp / ConsoleAppFramework

Zero Dependency, Zero Overhead, Zero Reflection, Zero Allocation, AOT Safe CLI Framework powered by C# Source Generator.
MIT License
1.54k stars 88 forks source link

Enable (param string[] something) to accept arbitrary number of parameters. #89

Closed igadmg closed 1 year ago

igadmg commented 1 year ago

For declaring some command like this [Command("run", "Run commandlet.")] public async Task RunCommandlet([Option(0)] string commandlet, [Option(1)] params string[] parameters) if last indexed parameter is params then it will accept all leftover parameters from command line

For example myprog run CommandletName param1 param2 - param1 param2 will be put to parameters array In case of myprog run CommandletName - parameters will be empty.

Sorry for big diff. converted all tabs to spaces as it should be in whole projec.t