-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Unify Glob arguments into one Argument #155
Conversation
The Glob enum has been introduced in order to get rid of duplicated settings. This makes the Checking of the provided arguments easier in source code since Enums are Exhaustive. This comes at a minimal usage friendliness degradation since now it would be needed to specify "--glob insensitive" instead of "--iglob". Even then I think it is worth it :3
Hmm I like where this is going but I feel like |
I've had this thought too, but I don't really know how to do it, even after looking into it. fd has implemented their Glob as a boolean, just like we did at the beginning. #[arg(
long,
short = 'g',
conflicts_with("fixed_strings"),
help = "Glob-based search (default: regular expression)",
long_help
)]
pub glob: bool, |
The command macros for the Context struct now use the Cargo.toml values of the packages, since they are the same. The will be no need to change the "version" in both, the mod.rs and the Cargo.toml file, when the version is bumped up.
I'm not really sure off the top of my head how to do this nicely with One argument i found for keeping |
Seems good to me 👍 |
Should I close this PR then, or adjust the Code to your suggestion? |
If you wouldn't mind changing to my suggestion that'd be great. I like some of the other code refactors in this PR :] |
Alright, everything should be ready to go now. |
Oh nice! Thanks for taking care of #158! Much appreciated. Would you mind just fixing the merge conflicts? Once that's done and I run the workflows I'll get this merged in after breakfast :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging in a bit! Thanks for your help as always!
This comes at a degradation of usage friendliness.
Before:
After:
It is worth it, though, since it is now harder to mess up the Argument checking in the Source Code.
Enums are exhaustive, after all.
The usage degradation could be minimized by using a shortcut for “--glob”. “-G” or “-g” for example.