While I agree with all of this in theory, I think it's probably reasonable for people writing shellscripts today to assume the presence of `less`. It was even in SunOS 5...
`more` may have been improved over time, but to the best of my knowledge it still doesn't do everything `less` can, like switching to tail mode with `F` while viewing a log file. FreeBSD doesn't even ship `more` anymore (anyless?), I don't think - `man more` shows the manpage for less. So I think this is a case where literally, "less is more".
I confess I haven't used `pg`. Debian doesn't even provide it.
Including bash-isms in a supposedly portable script is definitely beyond the pale, though
(Possibly relevant to @b0rk 's interests)
So I hit a flag in diff, --unchanged-group-format
. It does not show up in the manpage. It does not show up in --help. You can search both those channels for that string and you will not find it.
You know where it shows up first? If you Google it, you'll get an example in https://www.gnu.org/software/diffutils/manual/html_node/Line-Group-Formats.html.
So why doesn't it show up in the manpage? Well, it does! If you read the entire manpage. With your eyes.
-D, --ifdef=NAME output merged file with '#ifdef NAME' diffs
--GTYPE-group-format=GFMT format GTYPE input groups with GFMT
--line-format=LFMT format all input lines with LFMT
--LTYPE-line-format=LFMT format LTYPE input lines with LFMT
These format options provide fine-grained control over the output
of diff, generalizing -D/--ifdef.
LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or 'changed'.
"What do you mean it isn't documented? Of course it's documented. You did read every line and do some template-substitution in your brain, didn't you?"
This isn't advocating for not reading the manpage. If you really want to understand how the tool works, you read the whole manpage. And probably the source code.
... but I don't want to understand how the tool works. I want to diff two files and not have the lines that are the same get emitted.
And I think a lot of application- and solution-generating computer people, most of the time, in most of their careers, are operating on that level of depth. Problems come in too fast and with too much variety. You absolutely go deep on some things. There is no time to go deep on everything.
So how do we address this (other than throw up our hands and say "Relying on Google's fuzzy search of the whole Internet and vibe-coding LLMs is the future actually")? I don't have magic bullets, but a "fuzzy search" mode in something like less
that could take an input like --unchanged-group-format
and twig that it if there's no exact match, it might be related to --GTYPE-group-format
would be nice.
Maybe I should mock that up in emacs. Actually, I bet someone already put it in emacs. ;)
Eingeständnis oder #Marketing-Fail?
#Less plastic #Recycling
The less I need, the better I feel.
With the sound of pursuit approaching, they reined in at a fork in the trail.
"Which way?" asked the barbarian.
The rogue pointed left. "This one. #Less of them'll follow."
"That's wrong," snapped the seer.
"Okay, you should know." The barbarian trotted right.
The rogue glanced at his remaining companion with suspicion. "Why was I wrong?"
"You meant 'fewer', is why."
The #MastoPrompt for Thursday 5 December 2024 is:
The poem or story can include the prompt word or be about the prompt word.
@ me, if you like, or just include the #MastoPrompt tag (to allow people to follow or filter their feeds), or keep your work to yourself - all the options are good as long as you're writing.
If you're including an image please do include alt-text so I can boost your post.
#Writing
#SmallPoem
#Poetry
#Fiction
#MicroFiction
#SmallStories
Lesspipe.sh: Alles ist eine Textdatei
Lesspipe.sh ist ein Werkzeug, welches dem Programm Less ermöglicht verschiedener Dateiformate die Text enthalten zu öffnen.
Just lovely warm glow of the #Moon's orb, backlighting the silhouetted blades of a few #tree #leaves, against a #black #nightsky. Stunning minimalist composition shows us how very much #less can be.
#MoonPhoto retooted from Murray GM - Paperposts (@Paperposts). [Is it "missed-it" or "miss-edit"?]
https://zirk.us/@Paperposts/112850424397769561 25 Jul 2024
Compiling the latest release of less so I can get that sweet, sweet wordwrap feature.
#Less #Debian #ThatDebianLife #CompileIt!
Umm... can someone who has the spoons handy log an issue that their latest release (non-beta) tarball is double-gzipped? (https://github.com/gwsw/less/issues)
#SpoonTheory -- I'm doing fine, but dealing with github REALLY DOES cost a couple extra spoons even when you're having a good day, lol. Stop using that MSFTy GPL-violating crap, my peeps! :P~
Today's card is 10 of Wands
The less you carry around, the less you have to remember.
I spent the last three days cleaning up and refactoring one of DokuWiki's core dependencies - the LESS compiler:
https://github.com/splitbrain/lesserphp?tab=readme-ov-file#lesserphp-reloaded
It will probably take a few more days before it can be swapped in.
Personally I would love switching from #LESS to #SCSS but doing that without breaking hundreds of plugins and templates isn't easily done.
Maybe we can skip using a pre-processor completely in the future when #CSS nesting is approved and in major browsers...
TIL less --IGNORE-CASE
> Like -i, but searches ignore case even if the pattern contains uppercase letters.
Also learned that less has lots of these --LONG-NAME flag variants
Which is your favourite?
#Photo #Photography #Snow #2021 #Yorkshire #Landscape #Snowodon #Minimal #Swan #Marcescence
Today's card is 2 of Pentacles.
As time marches on, do you want more from life, or are you happy to settle for less than you originally wanted?
#more #less #settle #ambition #dreams
#tarot #TarotMessage #TarotGuidance
#EverydayWitchTarot #TarotReader
#LauraJK32
@OldAndCranky A great New Year's resolution.
#Less social media.
me: okay, setting LESS=-J breaks `git diff` (it shows raw escape codes instead of colors)
me: shouldn't options set in $LESS be _combined_ with those Git sets?
me: sets LESS=
git diff: still borked
me: looks at ps while git diff is running to see what it actually calls
ps: /usr/bin/pager
ps: no options
me: traces the symlinks, look fine
me: checks his .gitconfig for pager nonsense, nothing
me: reads git-config(1)
Git: I pass my options using $LESS, but only if it's unset