chgrp: add --from parameter similar to chown
commitda091b3ab33a31f1354b8ab42915faf15c3c4745
authorPádraig Brady <P@draigBrady.com>
Wed, 27 Sep 2023 19:32:06 +0000 (27 20:32 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 15 Dec 2023 13:19:27 +0000 (15 13:19 +0000)
tree07a1c47e0fe5cf7ef3084661a6828e003b8a337b
parent0d9547474d001e2903c18164d8929f5d2d2c0dd7
chgrp: add --from parameter similar to chown

* doc/coreutils.texi (chown invocation): Convert --from option
description to a macro and call from ...
(chgrp description): ... here.
* src/chown-core.h (emit_from_option_description): A new function
refactored from ...
* src/chown.c (usage): ... here, and called from ...
* src/chgrp.c (usage): ... here.
(main): Accept the --from option as chown(1) does.
* po/POTFILES.in: Add chown-core.h as now translated.
* tests/chown/basic.sh: Decouple the root user from id 0.
* tests/chgrp/from.sh: A new test largely based on chown/basic.sh.
* tests/local.mk: Reference the new test.
* NEWS: Mention the new feature.
Suggested by Ed Neville.
NEWS
doc/coreutils.texi
po/POTFILES.in
src/chgrp.c
src/chown-core.h
src/chown.c
tests/chgrp/from.sh [copied from tests/chown/basic.sh with 54% similarity]
tests/chown/basic.sh
tests/local.mk