shuf: include all echo args, not just the last#5978
Conversation
|
CI failed, and I see a similar ICE panic when I run pre-commit (specifically Anyway, stable clippy ( EDIT: Also, I cannot reproduce the CI test failures of |
|
You can ignore both failures, they're known issues :) |
tertsdiepraam
left a comment
There was a problem hiding this comment.
Nice work! I just think there's one case that's not handled correctly by this.
639702e to
b091911
Compare
|
Changes since last push:
|
|
GNU testsuite comparison: |
|
Good job, thanks! |
This PR fixes all
shufbugs around repeated arguments:--echo. uutilsshufcurrently only considers the very last--echo, and ignores all the others.-n), effectively only considering the lowest. uutilsshufcurrently only considers the very last--head-count, and ignores all the others.shufcurrently only considers the very last element each, silently ignoring all the others.This is clearly buggy, since command-line arguments should be ignored only in exceptional cases. This appears to be a regression after #3329.
In this PR I'm fixing these and adopt the behavior of GNU, which is in my eyes the only sane reaction to those scenarios. Of course, this PR also adds tests for that.
I'm entirely new to uutils, so please do point out any resources that might help me. (I've already read {DEVELOPMENT,CONTRIBUTING,CODE_OF_CONDUCT}.md.)
Multiple echos example
The following demonstrations are run with this diff applied, to see what's going on:
Behavior before this PR:
Note that
shufisn't even aware thataandbwere passed in.Behavior after this PR: