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

Fix basename issue and simplify code #228

Merged
merged 1 commit into from
May 4, 2020

Conversation

syohex
Copy link
Contributor

@syohex syohex commented May 4, 2020

basename command cannot take multiple arguments in POSIX specification.
Coreutils version has --multiple option however it is not portable.
So use zsh :t modifier instead. You can also avoid this issue by using xargs -n1 however it makes slow.

Following error occurs if user installs multiple tbls sub-commands

 basename: extra operand ‘/home/shohei/bin/tbls-foo’

Reference about :t modifier

t [ digits ]
Remove all leading pathname components, leaving the final component (tail). This works like ‘basename’. Any trailing slashes are first removed.

basename command cannot take multiple arguments in POSIX specification.
Coreutils version has `--multiple` option however it is not portable.
So use zsh `:t` modifier instead
@k1LoW k1LoW added the bug Something isn't working label May 4, 2020
@k1LoW k1LoW self-assigned this May 4, 2020
@k1LoW
Copy link
Owner

k1LoW commented May 4, 2020

@syohex WOW !!!! THANK YOU !!!!

@k1LoW k1LoW merged commit 6f497d4 into k1LoW:master May 4, 2020
@syohex syohex deleted the syohex/basename-issue branch May 4, 2020 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants