Control: tag -1 upstream
Hello Marnanel,
Thank you for your contribution!
Marnanel Thurman [2025-12-16 23:53 +0000]:
> At present, scour requires an input and an output filename. This is
> occasionally a nuisance, especially in automated processing: it requires the
> output file to be renamed over the input as a separate step.
>
> Attached is a patch to add an --in-place / -I switch. I'm not sure the switch
> names are the most appropriate, however.
I think it's ok -- sed calls it -i and --in-place as well, that's a good
reference. -i is already taken of course.
| - if options.in_place:
| - # at this point, infilename is not None, and outfilename is None
| - options.outfilename = f'{options.infilename}.{os.getpid()}.temp'
Note, the patch is in the opposite direction again.
I don't like the static `.temp` suffix. It *should* be alright, but it's
dangerous/racy with parallel invocations.
Can you please forward this upstream? This changes behaviour and public API,
which isn't a good idea on the distro level. I don't expect that it actually
lands, but at least it's more visible and might spark some discussion from
other community members. I'm open to apply it in a month or so after that.
Cheers,
Martin