Replace pflag with Ra #38
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
spf13/pflag is great, but Rad has been straining it for quite some time.
It's too opinionated about POSIX. For Rad, we'd like to allow users to
breach POSIX compliance at their discretion, such as having varargs to
their scripts. pflag does not support this.
Hence the implementation of Ra (https://github.com/amterp/ra). This
commit migrates Rad entirely from pflag to Ra. This is quite a big lift,
and changes some nuanced behaviors of Rad. I will no doubt uncover
many-a-bug from this point onwards, so will be an ongoing thing.
Ra is built on principles we've already been using in Rad, for example
typed args, dual-nature of args (positional/flag), etc, but the idea is
that it can support more, which we will later leverage in Rad e.g. var
args.