Skip to content
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

Feature request: string pad #7102

pmlandwehr opened this issue Jun 9, 2020 · 2 comments

Feature request: string pad #7102

pmlandwehr opened this issue Jun 9, 2020 · 2 comments


Copy link

Would it be possible to get a string pad function to complement string trim? I realizing that padding can effectively be accomplished using things likeprintf "%<n or negative n>s\n" $strs_to_pad | tr " " "<padding char>", but it seems like a natural extension.

I'm at fish, version 3.1.2 on Mac OS X

@faho faho added this to the fish-future milestone Jun 14, 2020
Copy link

m0nhawk commented Jun 18, 2020

I made an attempt to implement that. It works like that (from my build directory):

❯ ./fish -c "string pad -l -r -n 10 --chars c test"
❯ ./fish -c "string pad -l -n 4 --chars ' ' foo"

I would be thankful for guidance on making this into upstream.

Copy link

@m0nhawk apologies for long delay, I'd be happy to review your changes if you would like to open a PR! Let us know if you have questions about how to do so.

@zanchey zanchey linked a pull request Jul 8, 2020 that will close this issue
3 tasks
@m0nhawk m0nhawk mentioned this issue Sep 19, 2020
3 tasks
@krobelus krobelus modified the milestones: fish-future, fish 3.2.0 Sep 27, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

Successfully merging a pull request may close this issue.

5 participants