Skip to content

rm: keep missing-operand error after -f with -i/-I - #16028

Merged
sylvestre merged 2 commits into
uutils:mainfrom
Logic769:rm-force-interactive-missing-operand
Nov 4, 2026
Merged

sylvestre merged 2 commits into
uutils:mainfrom
Logic769:rm-force-interactive-missing-operand

Conversation

@Logic769

Copy link
Copy Markdown
Contributor

Problem

rm -f -i (and -f -I) with no operands silently succeeds, but GNU rm still reports the missing operand. -f only suppresses prompts; it does not suppress the missing-operand diagnostic.

Change

Move the empty-operand check after the interactive/force flags are resolved, so a later -i/-I/--interactive cancels an earlier -f and the missing-operand error is still raised. Added regression tests for -f -i, -f -I and -f --interactive-always.

Closes #15994

@Logic769
Logic769 force-pushed the rm-force-interactive-missing-operand branch from 3d08435 to f60c024 Compare October 30, 2026 13:02
Comment thread src/uu/rm/src/rm.rs Resolved
Comment thread tests/by-util/test_rm.rs Resolved
@sylvestre
sylvestre force-pushed the rm-force-interactive-missing-operand branch from 0b9510c to e69dda6 Compare November 3, 2026 00:54
@sylvestre

Copy link
Copy Markdown
Contributor

a bunch of jobs are failing

@Logic769
Logic769 force-pushed the rm-force-interactive-missing-operand branch from e69dda6 to 49ff7d9 Compare November 3, 2026 15:43
@Logic769

Logic769 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Failure

Tests job: https://github.com/uutils/coreutils/actions/runs/41666802640/job/126024180896

The job fails while building the uucore doctests:

failed to determine the most recently modified file in /home/runner/work/coreutils/coreutils/src/uucore
Failed to read the directory at '/home/runner/work/coreutils/coreutils/src/uucore/uucore_fs_test_identical_1'
...
error: extern location for libc does not exist: /home/runner/work/coreutils/coreutils/target/debug/deps/liblibc-dd96f561c648205a.rlib
error: doctest failed, to rerun pass `-p uucore --doc`

Reason

This is the known uucore test-directory race: filesystem tests create and remove temporary directories under src/uucore while Cargo is fingerprinting that package. The missing uucore_fs_test_identical_1 directory makes the fingerprint scan fail, which then cascades into missing extern locations. It is unrelated to the rm argument-handling change in this PR. Re-running the job should clear it.

@sylvestre
sylvestre merged commit 2e97f95 into uutils:main Nov 4, 2026
100 of 101 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

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.

rm: -f -i with no operand should report a missing operand

2 participants