Commit Graph

16 Commits

Author SHA1 Message Date
Andreas Kling
6ad427993a Everywhere: Behaviour => Behavior 2021-09-07 13:53:14 +02:00
Karol Kosek
791309a3d2 Utilities: Support grepping recursively from paths in the argument
Previously, the recursive flag always searched for file contents from
the current directory, ignoring the path argument entirely.
2021-09-04 15:36:31 +04:30
TheFightingCatfish
fdde19d616 Utilities: Add option to control when to use colored output for grep
Fixes #9351.
2021-08-12 18:57:21 +02:00
Ali Mohammad Pur
eca74088a0 grep: Use Basic POSIX regexps by default and make -E not the default 2021-07-10 13:33:08 +02:00
Gunnar Beutner
3bbe86d8ea Everywhere: Prefer using "..."sv over StringView { "..." } 2021-07-04 14:24:03 +02:00
Sahan Fernando
7ee73b3721 Userland: Fix double line spacing in grep 2021-06-14 16:27:02 +02:00
Linus Groh
f5c35fccca Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
r-paiva
68de9008e7 Utilities: Fix grep match when reading from stdin
When reading from stdin, grep discards the last character,
even if that character is not \n.

This commit changes grep to no longer discard the last character from
a line.
2021-05-20 23:53:06 +02:00
Jean-Baptiste Boric
3038edab00 Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
Ali Mohammad Pur
a91a49337c LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
2021-05-12 11:00:45 +01: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
5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00
AnotherTest
6f9e6e63b6 grep: Exit with 1 if nothing matches 2021-02-15 17:32:56 +01:00
Andrew Kaster
258a3b27ac Userland: Implement grep -v (invert-match)
This will make grep output every line that doesn't have
any matches of the given regular expression
2021-01-25 09:41:19 +01:00
Andrew Kaster
036828ff43 Userland: Use getline instead of Core::File::standard_input in grep
Core::IODevice (which Core::File inherits from) does not have a
reasonable way to block for a line. grep was spinning on
IODevice::read_line, passing endless empty strings to the matcher
lambda. Use getline instead, which will at least block in the Kernel for
characters to be available on stdin and only return full lines (or eof)
2021-01-25 09:41:19 +01:00
Andreas Kling
ececac65c2 Userland: Move command-line utilities to Userland/Utilities/ 2021-01-12 12:04:09 +01:00