-
-
Notifications
You must be signed in to change notification settings - Fork 960
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
Let's use cut instead of grep! #520
Conversation
This is a small change that is being upstreamed from the "spacefish" fork of spaceship-prompt. While porting this prompt section to be fish-shell compatible, we found a more elegant solution for getting the rust version. Co-authored-by: Matan Kushner <hello@matchai.me>
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.
Thank you @Snuggle 👍
@Snuggle nice job with Spacefish! Feel free to add a link in our readme to this awesome fork! |
@salmanulfarzy That's a really good point! I've added an extra configuration option to enable showing that branch suffix in #521. (Since this pull request has already been merged/branch deleted.) It will default to the shortened version number, without a suffix, to follow CONTRIBUTING.md's "decluttering" guideline. ✨ ~ ~ ~ @denysdovhan Hey, thanks! I'll leave that to @matchai to add, since they're amazing at making things look beautiful and I feel like they'd like the honor of adding their project themselves! This is by far my favourite prompt and it's amazing to see such an awesomely made fork, and be able to collaborate to it. It's been a really nice first-project to start learning how to contribute on GitHub, especially because of the incredibly in-depth feedback I've recieved from @matchai. 😊 |
The main advantage with using cut, over using grep is increased compatibility with other coreutils while being much more concise. This has been tested using GNU, BSD, Ripgrep, Busybox and Toybox coreutils — the latter three would have failed otherwise, due to a grep flag incompatibility.
Description
This is a small change that is being upstreamed from the "spacefish" fork of spaceship-prompt. While porting this prompt section to be fish-shell compatible, we found a more elegant solution for returning the rust version number.
The main advantage with using cut, over using grep is increased compatibility with other coreutils while being much more concise. This has been tested using GNU, BSD, Ripgrep, Busybox and Toybox coreutils — the latter three would have failed otherwise, due to a grep flag incompatibility.
This change increases compatibility and cleans up a line of code.
Screenshot(s)