Commit graph

11 commits

Author SHA1 Message Date
Linus Groh 6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Baitinq 44ef0ac41c shuf: Support the output of a limited number of lines
This patch adds the "-n"/"--head-count" optional argument to specifiy
the maximum number of shuffled lines to output.

Idea from Andreas' FIXME roulette :^)
2022-11-29 11:44:05 +01:00
Eli Youngs c92f450ff0 shuf: Support splitting on null bytes with -z 2022-11-25 22:59:27 +01:00
Eli Youngs b2fd87950a shuf: Support reading input from a file
Previously, shuf exclusively read input from stdin. This PR adds an
option to read from a file using Core::Stream::File. Since a file might
contain arbitrary bytes, including null bytes, this PR represents lines
as Spans of Bytes instead of Strings.
2022-11-25 22:59:27 +01:00
Michel Hermier 176de579f2 shuf: Port to LibMain 2022-01-24 05:38:30 +00:00
SeekingBlues c63bdba955 shuf: Fix division by zero when no lines are read 2021-10-17 12:07:09 -07:00
Jean-Baptiste Boric 5a0468c21f Userland: Migrate from arc4random_uniform() to get_random_uniform() 2021-05-14 22:24:02 +02:00
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling ef1e5db1d0 Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)
Good-bye LogStream. Long live AK::Format!
2021-03-12 17:29:37 +01:00
Andrew Kaster c2d8b8ec14 Userland: Don't leak buffer from getline in shuf program
Probably doesn't matter too too much since the program exits almost
immediately after, but there's the principle of the thing to consider.
2021-02-28 18:19:37 +01:00
Ben Wiederhake de98f69bfe Userland: Implement shuf for basic shuffling 2021-01-20 19:19:34 +01:00