Skip to content

coreutils: support --coreutils-prog utility selection - #15489

Open
limadog9 wants to merge 1 commit into
uutils:mainfrom
limadog9:fix/coreutils-prog-option-9575
Open

limadog9 wants to merge 1 commit into
uutils:mainfrom
limadog9:fix/coreutils-prog-option-9575

Conversation

@limadog9

Copy link
Copy Markdown
Contributor

Support --coreutils-prog=UTIL when invoking the multicall binary, including under an unrecognized name or through a shebang wrapper. Help and diagnostics use the selected utility name.

Add coverage for argument forwarding, exit status, invalid utilities, aliases, and shebang execution. All 20 multicall tests pass.

Closes #9575.

@oech3

oech3 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

I'm not sure if we really want to support this.

Comment thread docs/src/multicall.md Outdated
The utility can also be selected with `--coreutils-prog=UTIL`, including when
the binary is invoked under an unrecognized name. This supports script wrappers
that use the multi-call binary as their interpreter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need to document this since this option is needed only for creating shebangs at build time.

@limadog9
limadog9 force-pushed the fix/coreutils-prog-option-9575 branch from fd3dbe1 to e957d89 Compare October 18, 2026 17:36
Comment thread src/uucore/src/lib/lib.rs Outdated
.into_owned()
.to_string_lossy();
if get_utility_is_second_arg() {
name.strip_prefix("--coreutils-prog=")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uucore can be used as a library. So this logic should be part of coreutils itself.

@limadog9
limadog9 force-pushed the fix/coreutils-prog-option-9575 branch from e957d89 to 71d7d8f Compare October 18, 2026 17:39
Comment thread tests/test_util_name.rs Outdated

#[test]
#[cfg(all(unix, feature = "echo"))]
fn coreutils_prog_shebang() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this. This is just an usecase. Thus, this is duplicated test.

@limadog9
limadog9 force-pushed the fix/coreutils-prog-option-9575 branch from 71d7d8f to ab063ca Compare October 18, 2026 17:43
Accept --coreutils-prog=UTIL for explicit utility selection, including
when the executable has an unrecognized name. Parse the option in the
multicall entry point and provide the selected display name through a
generic uucore override.

Cover argument forwarding, exit status, invalid utilities, and aliases.

Closes uutils#9575.
@limadog9
limadog9 force-pushed the fix/coreutils-prog-option-9575 branch from ab063ca to 5a943b1 Compare October 18, 2026 17:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

coreutils: Should we really support --coreutils-prog=yes too?

2 participants