mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
grep: Recognize mode based on the program name
This commit is contained in:
parent
0865a06ef5
commit
4a5d1db7f6
1 changed files with 5 additions and 2 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/ScopeGuard.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
|
@ -36,10 +37,12 @@ ErrorOr<int> serenity_main(Main::Arguments args)
|
|||
{
|
||||
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||
|
||||
String program_name = AK::LexicalPath::basename(args.strings[0]);
|
||||
|
||||
Vector<const char*> files;
|
||||
|
||||
bool recursive { false };
|
||||
bool use_ere { false };
|
||||
bool recursive = (program_name == "rgrep"sv);
|
||||
bool use_ere = (program_name == "egrep"sv);
|
||||
Vector<const char*> patterns;
|
||||
BinaryFileMode binary_mode { BinaryFileMode::Binary };
|
||||
bool case_insensitive = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue