Closed ghost closed 3 years ago
Wow! This is a cool script. The colorization part looks especially impressive. Of course, it is already perfect as it is, but I would make add several minor suggestions:
[-t 1]
), automatically pipe it less -EXFR
;# pylint disable=...
, because there will be some sheets that must be longer than 80 characters, and lenchk
should be able to skip them.$(dirname "${BASH_SOURCE[0]}")"/sheets/
by default (but the directory could be overridden, see 3).Very cool script without a doubt. We will bind it to CI-checks, and this colorization feature will shine even brighter in CI-reports :)
I'm glad you're so happy with it! :D
Oh, so you basically think using a pager should be the default setting? Can do.
Oh yeah, thanks; forgot about that.
It's already non-recursive; were it so, I'd have used the **
syntax in the main for loop. Unless you meant something else. The adding of directories per args sounds like a solid idea, so I'll get on that.
That's a good idea. I'll add a whitelisting flag.
Woah. Mind blown. I'm surprised I'd never really come across the $BASH_SOURCE
array variable, but I'll get on using that; that's really gonna be useful in all my projects!
Thanks, Chubin. If there are any other tests needed, let me know.
BTW, can you test using the -c
flag with less? Reason being, I'm seeing some weirdness on my end, but it's probably because of my less configuration (TERMCAP stuff) and/or version.
Notice some output got 'stuck', as it were? Weirdly, though, if you scroll away then back, that line(s) vanishes and the rest displays normally. This only occurs if colorization is enabled.
git
does it (but only in case terminal is attached, of course).${BASH_SOURCE[0]}
is not portable, but it has that advantage comparing to $0
, that if you source the script with source
(or .
), it points to the real filename, and not to the base script where source
is called, that's why I prefer it.Regarding your question about garbage: I suppose you mean the "found lines" output, that goes to stderr; if you run it with 2>&1
, it will be piped into less
too, and this unpleasant effect will disappear
Thank you. That sorted out my garbage issue. I guess that's a side-effect of less-ing.
Still not clear on 2 -- sorry. No descending occurs due to the way in which the for loop works. Are you saying that you want the option to descend into subdirectories? If so, I can add the ability to do that via the usual -R
/-r
flag.
In my case it descends by default (as if this future option -r
already exists and specified)
You see those _scala/...
, _swift/...
, etc?
That's normal, but I think I see what you're looking for, now. See, when you were talking about descending, I thought you meant beyond what was supplied in the for loop (../sheets/*
and ../sheets/*/*
). Now that I know what you're after, I can sort that.
Please refer to the commit message.
If this isn't what you had in mind, like if it's not meant to be interactive at all, but you still want to have it as an additional tester, let me know, and I'll restore the original file in the next commit.
If you use this file, I only ask that the header (my GitHub & E-Mail) remain; beyond that, I'm not bothered, as long as you guys are happy. :)