-
Notifications
You must be signed in to change notification settings - Fork 314
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
Advice for users of the argument parser in swift-tools-support-core ? #5
Comments
Reading the Swift blog announcement, I believe it's safe to say that Therefore I suggest any new and current project to migrate-to/use |
I switched |
I've tried to migrate Carting and it was surprisingly easy! The biggest pro for me is reusing arguments for different commands. You can check my changes here. |
The argument parser in swift-tools-support-core was written in 2016 for Swift build tools like SwiftPM and LLBuild. It served SwiftPM for many years but I've been hoping to improve the API as it doesn't scale very well when you have large number of subcommands and flag. This new parser has a much much nicer API. My hope is that we can adopt the new argument parser in SwiftPM and kill the one in swift-tools-support-core. |
If you will excuse chatter from someone who's been programming for fifty+ years, I really like this library. When us graybeards talk over a beer about 'modern' programming, we tend to claim that there's little new in our business; it's mostly re-cycled. But, I think Swift is driving us into new paradigms and |
I've also done the transition for my library in this PR. Took me about an hour - really amazing work by everyone involved!! |
So happy to see the enthusiasm here! If there's more to continue in this conversation, let's take it up in the ArgumentParser forum section. |
Swift Package Manager incorporates a stand-alone 'swift-tools-support-core' which provides an argument parser which seems to have a very similar feature set to 'swift-argument-parser' (and, incidentally, includes bash/zsh command completion), and some web tutorials have described the use of this component for command line tools.
Would those in the know, recommended that using 'swift-argument-parser' is a better choice over the argument parser in 'swift-tools-support-core' for any new work and that, maybe, even existing use of the 'swift-tools-support-core' argument parser should be curtailed and migrated to the new library?
I do appreciate that neither option is a finished work, that the world changes, and that any such advice should depend on the specific case in question. One specific case that would cast light on this is SwiftPM itself .. is 'swift-ap' expected to replace the current argument parsing done by 'swift-tsc' in SwiftPM (the Swift blog describes increasing incorporation of 'swift-ap' in various parts of the Swift Project)?
The text was updated successfully, but these errors were encountered: