Breaking: Completely rework how positional arguments are handled#178
Merged
FollowTheProcess merged 8 commits intomainfrom Nov 8, 2025
Merged
Breaking: Completely rework how positional arguments are handled#178FollowTheProcess merged 8 commits intomainfrom
FollowTheProcess merged 8 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #178 +/- ##
==========================================
- Coverage 91.50% 87.06% -4.44%
==========================================
Files 5 5
Lines 1260 1477 +217
==========================================
+ Hits 1153 1286 +133
- Misses 61 129 +68
- Partials 46 62 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
FollowTheProcess
added a commit
that referenced
this pull request
Dec 3, 2025
* Implement the arg.Value approach * Hook arg up (mostly) * Fix command tests expecting args in a different way * Add tests for the arg parsing mechanisms * Rename some stuff * Hook up the help * Update the docs * Update some tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Warning
This is a large breaking change
I've completed re-worked how positional arguments work, instead of getting the raw
[]stringpassed to theRunmethod, I've introduced a mechanismfor declaring type-safe structs describing the positional arguments, which are then inferred using generics and parsed similar to how flags already
worked.
As a result of this:
cli.Allowoption and all the argument validators as this new mechanism is much better and allows you to define exactly whatarguments you want and what types they are
cli.Runhas changed fromfunc(cmd *cli.Command, args []string) errortofunc(cmd *cli.Command) errorcmd.Args()See the updated
READMEand the updated examples for how to change your code to match the new behaviourNote
This is not yet complete, I still want to work out how slice types work in this new system but this is good enough for now