summaryrefslogtreecommitdiff
path: root/Userland/Utilities/grep.cpp
AgeCommit message (Collapse)Author
2022-04-11Utilities: Read positional arguments as Strings not char*sSam Atkins
This is a pretty trivial change so they're all batched together.
2022-04-03Utilities: Use default execpromises parameter to `pledge(..)`Brian Gianforcaro
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-20grep: Recognize mode based on the program nameTim Schumacher
2022-03-19grep: Properly update match state when handling filesTim Schumacher
2022-03-19grep: Adapt maximum line size depending on file sizeTim Schumacher
Otherwise, we would never stop trying to fetch new lines if the next newline is found beyond a range that the (default sized) buffer can hold.
2022-01-14grep: Port to LibMainLucas CHOLLET
2021-11-13Utilities/grep: Implement using multiple patternsTim Schumacher
2021-11-12Utilities/grep: Implement line-counting modeTim Schumacher
2021-11-08LibRegex: Don't push LibRegex's "Error" into the global namespaceAndreas Kling
2021-11-06grep: Add ability to output line numbersBen Wiederhake
2021-11-06grep: Simplify lambda signature for readabilityBen Wiederhake
Those 'optional' arguments are always supplied anyway. Making them compulsory means there's one thing fewer to keep track of.
2021-10-31Utilities: Add option to suppress errors to grepMarco Cutecchia
2021-10-31Utilities: Add 'quiet' mode to grepMarco Cutecchia
2021-09-07Everywhere: Behaviour => BehaviorAndreas Kling
2021-09-04Utilities: Support grepping recursively from paths in the argumentKarol Kosek
Previously, the recursive flag always searched for file contents from the current directory, ignoring the path argument entirely.
2021-08-12Utilities: Add option to control when to use colored output for grepTheFightingCatfish
Fixes #9351.
2021-07-10grep: Use Basic POSIX regexps by default and make -E not the defaultAli Mohammad Pur
2021-07-04Everywhere: Prefer using "..."sv over StringView { "..." }Gunnar Beutner
2021-06-14Userland: Fix double line spacing in grepSahan Fernando
2021-06-01Userland: Replace most printf-style APIs with AK::Format APIs :^)Linus Groh
2021-05-20Utilities: Fix grep match when reading from stdinr-paiva
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-17Utilities: Correct non-standard assert macros includesJean-Baptiste Boric
2021-05-12LibCore+Everywhere: Move OpenMode out of IODeviceAli Mohammad Pur
...and make it an enum class so people don't omit "OpenMode".
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
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-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...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-15grep: Exit with 1 if nothing matchesAnotherTest
2021-01-25Userland: Implement grep -v (invert-match)Andrew Kaster
This will make grep output every line that doesn't have any matches of the given regular expression
2021-01-25Userland: Use getline instead of Core::File::standard_input in grepAndrew Kaster
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-12Userland: Move command-line utilities to Userland/Utilities/Andreas Kling