-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
appsetting.json and NET5 #171
Comments
You can give this repo a try: https://github.com/Tarmil/Argu.MicrosoftExtensions. |
Would either of you (or @toburger) consider doing a PR that means the average user will be aware there is a valid approach? Perhaps a PR that:
(My concern here is this issue still sitting here in 2030 without anythign having moved forward - unpacking the above comments is definitely someone new to F# and/or .NET would not find trivial!) |
A quick play with the code suggests that moving Argu/src/Argu/ArgumentParser.fs Line 171 in feca25a
that wouldn't work any more in that case. (Note: I haven't used Argu yet, I was just looking at alternatives to (FSharp.)SystemCommandLine and thinking that a command line parser depending on the System.Configuration.ConfigurationManager stack isn't ideal) |
What sort of thing are you thinking of there? |
I personally have no interest in reading config files, much less having hardwired support for only one built in. My generic statement is intended to be open-ended, but I guess I was alluding to trade-offs like:
I resolve those forces via https://github.com/jet/dotnet-templates/blob/master/feed-consumer/Program.fs#L94 but that's hard-won, and there's definitely scope to put something in the repo, with docs that's sufficiently extensible. Given the build tooling is pretty decent, it would not be a problem to push out the config dependencies to an external Argu.AppSettings package The problem though, is to work out an abstraction that covers the above, i.e.:
Solving all of that is probably out of scope for this issue (some of these desires are covered in other issues). There's definitely room to so something "good enough for now" that moves things forward. If you and/or others have appetite, we could potentially do a I'm happy to muck in a bit and will definitely review things, but I'm reasonably well loaded atm with things that Need To Be Done in other projects so am not in a position to drive it. I'd definitely be able to validate a wide variety of consumption scenarios. In other words, if you have some capacity, there's a lot of potential - go for it! |
Hmm, I hadn't thought about anything to that detail (I was just looking at the command line parsing functionality, without any other sort of configuration), so I'd have to see if I have any time in the new year for anything further. As far as the ConfigurationManager dependency goes, I was just playing around with something like Numpsy@5b94ad7, which seemed like it worked with the same public api, except the point about not working as a 'default' functionality any more |
Sorry, only coming back to this now - your spike seems good. I suspect the massive majority Argu consumption scenario is massively weighted toward only using explicit parsing of the command line. The main concern is that the behavior change would be breaking - all this really means is that it would need to wait for a V7. So making a formal PR out of it might be good? Ideally there'd be some way to signal the change with a warning or obsoletion rather than relying on doc stuff that lots of people will miss and will then get bitten by. I personally won't have the time or appetite to go full in on doing a full job of letting people arbitrarily compose the read (and help generation) wiring (and ordering) as I alluded to earlier, but at least making the config parsing opt-in might be a good first step. I normally have a helper in my Arguments type like this
or a
If that became a one-liner such as Other light breaking changes like #211 might be worth considering alongside for V7. Then perhaps a V8 can do deeper stuff like making it pluggable, but as each supported has its own factory method, those can forward to a more generic pipeline factory thing. It might also be nice to do an equivalent of fsprojects/FSharp.AWS.DynamoDB#73 in the V7 timeframe, as the work to make the pipeline pluggable might involve some diffs that could be painful to review if we also have formatting inconsistencies in the mix) Any thoughts @nojaf ? |
Not many to be honest. It is probably worth exploring in v7 when breaking changes are on the table. |
aspnetcore and dotnet core app config has been moved to appsettings.json for a while, does argu support binding on that too?
The text was updated successfully, but these errors were encountered: