[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: diffman(1)
From: |
Alejandro Colomar |
Subject: |
Re: diffman(1) |
Date: |
Mon, 25 Nov 2024 14:35:45 +0100 |
On Mon, Nov 25, 2024 at 01:44:07PM +0100, Alejandro Colomar wrote:
> Hi!
>
> I've developed a new program (actually, a bash script) that diffs manual
> pages. I find it quite useful for quickly seeing differences between a
> page as installed in the system, and the file I'm working on. The
> output is diff -u of formatted manual pages (suitable for less -R).
>
> You can find it here:
> <https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=fa4743c43762cc3be4af9672ce12a7ed58f9a500>
> and soon in the <kernel.org> repo.
>
> The script is just a fancy version of
>
> diff -u \
> <(man -w "$1" | xargs groff -man -Tutf8) \
> <(man -w "$2" | xargs groff -man -Tutf8);
>
> I had to make it fancier for error handling, since process substitution
> doesn't propagate errors (not even with `set -Eeo pipefail`).
>
> You may find it useful for development of manual pages. If so, please
> let me know any feedback you have for it. I was wondering if I should
> pipe to less -R, just like man(1) does. For now, having doubts, I kept
> it simple, which would allow wrapping this in fancier scripts that for
> exaple diff an entire repository of manual pages (although that maybe
> calls for running groff(1) and diff(1) directly).
I've decided to keep it without piping to less(1). For piping, I'll let
users write their own wrapper, since it's trivial. I've called mine
duffman, which is like diffman(1), but with more fun. :-)
$ which duffman | xargs cat
#!/bin/bash
set -Eeuo pipefail;
diffman $@ | less -R;
duffman is not in the repo for now.
>
> Have a lovely day!
> Alex
>
> --
> <https://www.alejandro-colomar.es/>
--
<https://www.alejandro-colomar.es/>
signature.asc
Description: PGP signature