Re: `losetup --remove` is confusing, and misuse silently fails

Karel Zak <[email protected]> Fri, 7 Nov 2025 11:16:30 +0100
Newsgroups org.kernel.vger.util-linux
Message-ID <pdmvdt2cdvr57pwsyz3g7eehtyni2e5zfnz76mhf5rcsjwcfmm@kf7ergmarrsi>
On Mon, Nov 03, 2025 at 03:42:50PM +0100, Benno Schulenberg wrote:
> 
> Op 03-11-2025 om 13:49 schreef Karel Zak:
> > >    # ./losetup --remove --find --all
> > >    losetup: options --remove and --find cannot be combined
> > Implemented:
> >      https://github.com/util-linux/util-linux/pull/3835
> 
> Thanks!  However...
> 
> 	fprintf(stderr, _("%s: options "), program_invocation_short_name);
> 	ul_print_option(stderr, status[e], opts);
> 	fputs(_(" and "), stderr);
> 	ul_print_option(stderr, c, opts);
> 	fputs(_(" cannot be combined.\n"), stderr);
> 
> For translatability, the above should be like:
> 
> 	fprintf(stderr, _("%s: options %s and %s cannot be combined"), ...);
> 
> 
> See for example `info gettext prep prep`, saying that translatable strings
> should be entire sentences.

Yes, I know. The problem is that we need an extra buffer in the case
of the short-only option. I have updated the pull request to make it
more elegant. Now it uses:

    errx(OPTUTILS_EXIT_CODE,
        _("options %s%s and %s%s cannot be combined"),
        ....

so it's just one string.

    Karel




-- 
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com