191110.1 · 5f59972c6d78d73e03256da7aabe11607dd2bba3
Put the actions at the top of the help menu
reading declarations
@@ -15,6 +15,9 @@ directory These files would not normally be searched, because they're binary, but ignoring them based on extension is a speedup. +Reorganized the --help menu to put "action" options like -f, -g and -l at+the top of the listing.+ v3.2.0 Sun Nov 3 22:52:18 CST 2019 ========================================
@@ -222,7 +222,16 @@ or if one of them is "-". Default switches may be specified in an .ackrc file. If you want no dependency on the environment, turn it off with --noenv. -Example: ack -i select+File select actions:+ -f Only print the files selected, without+ searching. The PATTERN must not be specified.+ -g Same as -f, but only select files matching+ PATTERN.++File listing actions:+ -l, --files-with-matches Print filenames with at least one match+ -L, --files-without-matches Print filenames with no matches+ -c, --count Print filenames and count of matching lines Searching: -i, --ignore-case Ignore case distinctions in PATTERN@@ -239,8 +248,6 @@ Searching: --match PATTERN Specify PATTERN explicitly. Typically omitted. Search output:- -l, --files-with-matches Only print filenames containing matches- -L, --files-without-matches Only print filenames with no matches --output=expr Output the evaluation of expr for each line (turns off text highlighting) -o Show only the part of a line matching PATTERN@@ -251,7 +258,6 @@ Search output: -H, --with-filename Print the filename for each match (default: on unless explicitly searching a single file) -h, --no-filename Suppress the prefixing filename on output- -c, --count Show number of lines matching per file --[no]column Show the column number of the first match -A NUM, --after-context=NUM Print NUM lines of trailing context after@@ -299,10 +305,6 @@ File presentation: File finding:- -f Only print the files selected, without- searching. The PATTERN must not be specified.- -g Same as -f, but only select files matching- PATTERN. --sort-files Sort the found files lexically. --show-types Show which types each file has. --files-from=FILE Read the list of files to search from FILE.
@@ -11,9 +11,7 @@ This tests whether ack's command line options work as expected. use Test::More; -# --no-recurse is inconsistent w/--nogroup--plan tests => 42;+plan tests => 52; use lib 't'; use Util;@@ -22,13 +20,28 @@ prep_environment(); # Help for my $arg ( qw( --help ) ) {+ my @sections = (+ 'File select actions:',+ 'File listing actions:',+ 'Searching:',+ 'Search output:',+ 'File presentation:',+ 'File finding:',+ 'File inclusion/exclusion:',+ 'File type inclusion/exclusion:',+ 'File type specification:',+ 'Miscellaneous:',+ 'Filter specifications:',+ ); my @args = ($arg); my $results = run_ack( @args );- like(- $results,- qr{ ^Usage: .* Example: }xs,- qq{$arg output is correct}- );+ for my $section ( @sections ) {+ like(+ $results,+ qr{^Usage:.*$section}ms,+ qq{Found "$section" section}+ );+ } } # Version