Commit graph

10 commits

Author SHA1 Message Date
Sam Atkins
34940821f6 Utilities: Use new ArgsParser method for enum values 2023-09-24 23:41:22 +02:00
Tim Ledbetter
ba34931620 strings: Don't bail immediately on error
Previously, strings would exit immediately if there was an error
changing file ownership. We now print an error to stderr and
continue when an error occurs.
2023-06-26 19:28:42 +02:00
Tim Ledbetter
c723101728 strings: Add -o option as an alias for -t o 2023-06-26 19:28:42 +02:00
Tim Ledbetter
a2fb0768ff strings: Add commonly used long option names for -n and -t 2023-06-26 19:28:42 +02:00
Tim Ledbetter
ab1e8a7b91 strings: Replace the -p option with the more commonly used -f
Previously, the `-p` option printed the path of the file being
processed before any strings for that file. The `-f` prints the file
path before each string . This matches the behavior of strings on
Linux and FreeBSD.
2023-06-26 19:28:42 +02:00
Tim Schumacher
d5871f5717 AK: Rename Stream::{read,write} to Stream::{read_some,write_some}
Similar to POSIX read, the basic read and write functions of AK::Stream
do not have a lower limit of how much data they read or write (apart
from "none at all").

Rename the functions to "read some [data]" and "write some [data]" (with
"data" being omitted, since everything here is reading and writing data)
to make them sufficiently distinct from the functions that ensure to
use the entire buffer (which should be the go-to function for most
usages).

No functional changes, just a lot of new FIXMEs.
2023-03-13 15:16:20 +00:00
Ali Mohammad Pur
db886fe18b Userland+AK: Stop using getopt() for ArgsParser
This commit moves the implementation of getopt into AK, and converts its
API to understand and use StringView instead of char*.
Everything else is caught in the crossfire of making
Option::accept_value() take a StringView instead of a char const*.

With this, we must now pass a Span<StringView> to ArgsParser::parse(),
applications using LibMain are unaffected, but anything not using that
or taking its own argc/argv has to construct a Vector<StringView> for
this method.
2023-02-28 15:52:24 +03:30
Tim Schumacher
874c7bba28 LibCore: Remove Stream.h 2023-02-13 00:50:07 +00:00
Tim Schumacher
606a3982f3 LibCore: Move Stream-based file into the Core namespace 2023-02-13 00:50:07 +00:00
Alec Murphy
8677dbfc7f Utilities: Add strings 2022-12-04 12:08:48 +00:00