env: add -a,--argv0 to set the first argument passed to exec
commit193449b17334649a2abcbca589544d858fca92a1
authorPádraig Brady <P@draigBrady.com>
Thu, 2 Mar 2023 14:56:18 +0000 (2 11:56 -0300)
committerPádraig Brady <P@draigBrady.com>
Fri, 22 Mar 2024 13:12:52 +0000 (22 13:12 +0000)
tree4a4bb18505b9b455f1683760ac893e77ee71f632
parent91e69cd2d02f015fc296e02388e0b18a293faa56
env: add -a,--argv0 to set the first argument passed to exec

Using the shell's exec -a feature can be awkward
so add support for setting overriding argv[0].
This gives env full control over the arguments it passes.

* src/env.c: Accept -a,--argv0 and set argv[0] appropriately.
* tests/env/env.sh: Add test cases.
* doc/coreutils.texi (env invocation): Describe -a,--argv0.
* NEWS: Mention the new feature.
NEWS
doc/coreutils.texi
src/env.c
tests/env/env.sh