Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add random ordering for sort command #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pjsier
Copy link

@pjsier pjsier commented Aug 21, 2019

Adds random ordering to sort based on the comments in #181. It looks like the SeedableRng generation could be simplified with seed_from_u64 if rand_core is updated, but I wanted to check before doing that.

I'm pretty new to Rust, so happy to make changes if anything seems off. Thanks for maintaining this!

jqnatividad added a commit to jqnatividad/qsv that referenced this pull request Nov 5, 2021
Though this overlaps with the new `scramble` command, it's still useful to adapt this PR.

BurntSushi/xsv#185
@PCouaillier
Copy link

In your merge request you match on (false, false, true) and otherwise random value must be false. This may be confusing if someone provide --random, --seed and --reverse or --random --numeric (even if it makes no sense we do neither of those two)

We should emit a warning or at least force --random by matching on (_, false, true) and add the reverse pattern (if seed is provided it can make sense) (_, true, true).

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.

2 participants