Hi, I've got a question. The
System.CommandLine project was finally archived and will not be developed further. Could we possibly open new repository under this organization, which would host that implementation? It's rather unique in its own way, not using reflection, strongly typed, very lightweight, supporting very heavily UNIX style.
I could take on maintenance, but I thought it'd be better to host is as part of an already CLI Parsing - oriented team, rather than on my own.
@itadder Nice examples are here: https://github.com/commandlineparser/commandline#quick-start-examples
Also, yes. CommandLineParser by gsscoder is the correct package.
I don't really know what you want to do. Have you looked at the Quick Start Examples I've linked? First example:
You're passing new object of given type instead of either providing (as in quote above) generic type, or you could do
Unhandled Exception: System.MissingMethodException: Method 'CommandLine.OptionAttribute..ctor' not found. at Internal.Reflection.Extensions.NonPortable.CustomAttributeInstantiator.Instantiate(CustomAttributeData) + 0x528 at OpenSage.Viewer!<BaseAddress>+0x7f167c at System.Linq.Enumerable.<OfTypeIterator>d__59`1.MoveNext() + 0x7e at System.Linq.Enumerable.Any[TSource](IEnumerable`1) + 0x31 at CommandLine.Core.ReflectionExtensions.<>c__0`1.<GetSpecifications>b__0_2(<>f__AnonymousType9`2) + 0x26 at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() + 0x8f at System.Linq.Lookup`2.Create[TSource](IEnumerable`1, Func`2, Func`2, IEqualityComparer`1) + 0x5a at System.Linq.GroupedEnumerable`3.GetEnumerator() + 0x32 at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext() + 0x2e at System.Linq.Enumerable.Any[TSource](IEnumerable`1, Func`2) + 0x4b at CommandLine.Core.SpecificationExtensions.ThrowingValidate(IEnumerable`1, IEnumerable`1) + 0x8c at CommandLine.Core.InstanceBuilder.Build[T](Maybe`1, Func`3, IEnumerable`1, StringComparer, Boolean, CultureInfo, IEnumerable`1) + 0x19c at CommandLine.Parser.ParseArguments[T](IEnumerable`1) + 0xf7 at OpenSage.Viewer.Program.Main(String) + 0x38 at OpenSage.Viewer!<BaseAddress>+0x832c26
I'm developing a small .NET Core CLI app. For this, I want to make use of .NET Core's new Configuration Providers. The app shall be configurable via
appsettings.json, command-line and environment variables. Last but not least, I'd like to use the Options pattern (strongly-typed configuration classes).
When it comes to command-line configuration, .NET Core comes with the built-in Command-line Configuration Provider. But the syntax for overriding parameters in conjunction with the Options pattern is a bit ugly.
From other .NET applications I'm familiar to the wonderful Command Line Parser package. Is it possible to combine this package with the Options pattern so that I can make use of the .NET Core Configuration Providers (for environment variables and
appsettings.json) and pass arguments via command-line in a more pleasant form?
@mu88 I've been using this library for about 8 months now. From what I can tell just by looking at the API, class structure and how I've experienced the library behaves I think you should be able to use the same model for both approaches. The only thing that I can think of that might be a bit sketchy is when you'll have to merge both objects from different sources.
Please take into account that this is an attempt to answer your question without any concrete evidence of what I'm talking about hehe. I'm not even close to being an expert on this library.
Hope that helps a bit. If you need any further explanation on how I think this could be done I could try to explain it better or maybe even put togeter a proof of concept.
Either ay, good luck with that. :)