rm: skip prompt when stdin is not interactive; Fix #7326 - #7492
Conversation
|
Could you please add a test to make sure we don't regress? Thanks |
I'm going through the tests now which previously used a pipe to stdin and thus failing since they don't get the tested prompts by adding This brings me to a larger question.... Windows (where I'm developing) doesn't support Edit: going to call it a night and circle back tomorrow after some thoughts on |
|
GNU testsuite comparison: |
|
@kaathewisegit Since it was your comment about the public interface, do you have thoughts on the addition of I don't see any dependents described at crates.io and searched through NuShell, they're not yet using uu_rm so this doesn't appear to break other projects yet |
|
GNU testsuite comparison: |
|
Huh, that was quite awhile ago, let me see. Nope, that'll be a problem. Since One thing I'd suggest in general is implementing |
|
GNU testsuite comparison: |
|
For now I've added an implementation for |
|
GNU testsuite comparison: |
|
Greatly simplified the changes here after realizing I had read the man page incorrectly. It only skips the prompts while non-interactive and Not sure what that's about with the rustfmt style failing I got the opposite order on my windows machine, setup an Ubuntu 24.04 vm with fresh install of Rust to check and see if there was a version difference but I see the same, opposite that in the CI runner. Also looks like still got one of the GNU test cases failing, will correct that |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
Squashed to a single commit, rebased, and manually adjusted the order of the std::io import to match CI expectations
|
|
GNU testsuite comparison: |
|
Looks to me like |
|
Rebased |
|
GNU testsuite comparison: |
|
Looks like an intermittent |
|
kudos |
rm: skip prompt when stdin is not interactive; Fix uutils#7326
There's a currently redundant check in
prompt_file_permission_readonlywhich is unreachable due to being underprompt_filebut we add the extra check just in case the prompt should ever be used in a different codepath