Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/ugrep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6698,7 +6698,15 @@ void init(int argc, const char **argv)

// if no regex pattern is specified and no -e PATTERN and no -f FILE and not -Q, then exit with usage message
if (Static::arg_pattern == NULL && pattern_args.empty() && flag_file.empty() && !flag_query)
usage("no PATTERN specified: specify --match or an empty \"\" pattern to match all input");
usage(
"no search PATTERN specified.\n\n"
"Examples:\n"
" ugrep \"pattern\" .\n"
" ugrep \"\" . (match all lines)\n\n"
"For more help, run: ugrep --help"
);



// regex PATTERN should be a FILE argument when -Q or -e PATTERN is specified
if (!flag_match && Static::arg_pattern != NULL && (flag_query || !pattern_args.empty()))
Expand Down