Commit 8e8835b2 authored by Craig Small's avatar Craig Small

Merge branch 'fifteen_chars_warning' into 'master'

pgrep - adds warning that pattern exceeds 15 chars without '-f' option

Resolves many questions seen on forums around the web. Adds a decent warning about the behaviour.<br>
Ideas about better text?

See merge request !25
parents 18e7ebd2 4a7f9fca
......@@ -886,7 +886,14 @@ static void parse_opts (int argc, char **argv)
}
if (argc - optind == 1)
{
opt_pattern = argv[optind];
if ((!opt_full) && (strlen(opt_pattern) > 16))
xwarnx(_("pattern that contains program name longer than 15 characters will result in zero matches\n"
"Try `%s -f' option for thorough search."),
program_invocation_short_name);
}
else if (argc - optind > 1)
xerrx(EXIT_USAGE, _("only one pattern can be provided\n"
"Try `%s --help' for more information."),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment