Interactivity support in the argument parser

Hello there!

While preparing a blog post about interactivity in CLI tools, I ended up writing a property wrapper that encapsulated a logic around readLine(). Then I thought - how can I make it compatible with the argument parser?

After understanding that the solution wouldn't be so trivial or elegant, I searched the repository for interactivity. After looking into some issues and PRs, I found a few things: This was discussed more than 2 years ago already, in this post, and in some GitHub issues as well. Related to it, @KeithBirdKTH did some work in the feature/interactive branch. This branch currently doesn't show any new commits for a year.

This led me to wonder what's the current state of this feature, and I couldn't find any transparent information about it, or maybe a roadmap. The argument parser serves its purpose in an excellent way, and at the same time it could have some "advanced" features.

Another example of an issue that brings the same feeling is Provide Optional initial value for input property wrappers, which itself is related to two other similar issues, both open since 2020.

Of course there's the option to fork, or to use alternatives such as Vapor's ConsoleKit, but having the argument parser support it pushes even more the idea that Swift is the right choice for writing CLI tools with great user experience.

Do more people miss this functionality, and feel this way as well?

6 Likes

Indeed. I echo what I said on that linked post since not much as changed in this space since then.

2 Likes