-
Notifications
You must be signed in to change notification settings - Fork 2.3k
plugin/percol shellcheck
#1956
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
plugin/percol shellcheck
#1956
Conversation
d6cdb58 to
5e87c53
Compare
shellcheckshellcheck
5e87c53 to
7467dce
Compare
|
Rebased on master, no other changes to PR |
Addresses Bash-it#1632 And use `_log_warning`. Alsö, code style cleanup: quote things, handle unbound parameters, &c. Alsö alsö, short-circuit if not installed or inadequate _Bash_ version.
According to `shellcheck`, the `_tac` alias simply doesn't work. At all. Ever. See SC2262 and SC2263.
7467dce to
92282c4
Compare
Move `bind` below function definition
davidpfarrell
left a comment
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.
I'm pretty happy with this so I'm approving it BUT ...
There could have been some acknowledgement that this PR deprecates using tac when present in favor of always using tail -r ...
I did. It's in the commit notes: according to |
Hey @gaelicWizard, apologies for not noticing your related commit message. TIL that clicking the The alias approach was definitely borked ! BUT There are other ways to accomplish the I still feel that choosing to deprecate SIDE NOTE: I also wish the original PR for this had a comment in the code explaining the use. I was not able to confirm either of :
Without one of those being true, I'm not sure why one would add that logic present in the first place ... |
|
I think this is mergable right now, the |
|
@davidpfarrell, I had actually never heard of Since literally zero people use this plugin, as it's been broken since original commit (except for someone who has That said, I'm trying out EDIT: found a very-related discussion about |
|
Final thought for now:
$ TAC='tail -r'
$ time { history | ${TAC} | sed -e 's/^\ *[0-9]*\ *//' ; } | wc -l
16179
real 0m4.382s
user 0m1.839s
sys 0m2.616s
$ TAC='tac'
$ time { history | ${TAC} | sed -e 's/^\ *[0-9]*\ *//' ; } | wc -l
16181
real 0m4.306s
user 0m1.756s
sys 0m2.621s |

Description
Adopt
_command_exists, use_log_warning, some cleanup,shellcheck, and finallyshfmt.Motivation and Context
This was part of my
_command_existsbranch (#1938) but was out of scope.How Has This Been Tested?
Types of changes
Checklist:
clean_files.txtand formatted it usinglint_clean_files.sh.