-
Notifications
You must be signed in to change notification settings - Fork 14
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
[Library] Commandline parsing #225
Comments
I've used ManyConsole in production in the past and it is similar to NDesk.Options, but I found it much easier to work with. |
|
Probably, yeah - I don't know how different |
I think EDIT: It looks like |
We've been using Unfortunately it's not actively maintained by Microsoft anymore, but there's a community fork with active maintenance. We haven't found the original NuGet package lacking, though. Only thing I'd say is that our command lines are very simple, so this package might not be enough for what's being discussed here. |
Looking at the libraries, I'm finding it difficult to distinguish between what we should be using. Does anyone have any strong opinions? |
I haven't used any of the other libraries mentioned in this issue, but my preference would be anything that fits the following criteria:
After a quick browse, my vote goes to CommandLineParser to go in Explore since it seems to tick all those boxes. |
@nyctef Sounds like we're about ready for a PR - do you want to make one that summarizes this discussion and we can resolve this? |
I forgot to mention - I did some spiking a few weeks back of the command line libraries mentioned here. The code is here for anyone wanting to compare them. All of the implementations do the same thing. From working with them all, It's probably also worth considering this library, as it's just been released by the .Net team and is part of the .Net Foundation, so is likely to gain some traction as it looks like it might be their new way of doing command line parsing. |
I've found that
commandlineparser/commandline#69 It's possible to work around it by handling multi-level parsing yourself in some way, but that's not ideal. I previously evaluated System.CommandLine, mentioned by @adrianbanks, but while it's powerful I don't think it supports an attribute-based API at the moment, which makes it a bit less readable and more of a change if you're used to I've found CommandLineUtils to probably be the best balance right now, supporting similar semantics to (I'm not sure where I should be recording this other than here.) |
Also, CommandLineParser seems to be abandoned, really. :( I'd propose to move CommandLineParser from Explore to Endure/Retire. :( |
FWIW I'd probably prefer to use System.CommandLine over handrolling something else |
The main problem I have with |
What change would you like to make to the tech radar?
Add
CommandLineParser
to ExploreAdd
NDesk.Options
to AdoptAdd
RedGate.Legacy.CommandLine
to EndureWhy do you believe this is valuable to Redgate?
Some discussion in this thread: https://redgate.slack.com/archives/CEXRY1B0B/p1550056281025600 (thanks @chrisgeorge0911 for pointing out this should be on the radar :)
Most of our new commandline tools actually use Powershell instead of parsing their own commandline arguments, so we haven't needed a commandline parsing library in a while.
Older tools (such as the SQL Compare commandline) use the
RedGate.Legacy.CommandLine
package that's been pulled out of SHU - it's not ideal, but it's working well enough for the moment. I think NDesk.Options is a pretty good drop-in for these projects - it's currently being used by the existing Oracle tools and we've used for some of the pre-powershell DLM Automation tools in the past. While the project isn't under active maintenance (there's a single official nuget package from 2011), it still works, and the library itself is pretty tiny if we ever needed to take control of it for ourselves.As an alternative, we'd like to have a go with
CommandLineParser
. The advantage here is that the library nicely supports having multiple 'verbs' (similar togit commit
/git add
/git status
/ etc). The reason we want to build a new commandline (instead of going for powershell) is that we believe Oracle users are much more linux-based and are less likely to adopt a solution that requires powershell. There are a few existing usages in RG, but nothing extensive: https://codesearch.red-gate.com/?q=%5CbCommandLineParser%5Cb&i=nope&files=&repos=Where should this be on the tech radar?
Probably in
radar_libraries.csv
under Redgate/Public NuGet?If this should be in the Explore ring, who is committed to exploring it?
Team Orca
The text was updated successfully, but these errors were encountered: