Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing options to help text and reformat #28

Open
ryandesign opened this issue Nov 26, 2023 · 0 comments
Open

Add missing options to help text and reformat #28

ryandesign opened this issue Nov 26, 2023 · 0 comments

Comments

@ryandesign
Copy link

In #27 I submitted some minor corrections to the help text but more extensive editing is still needed. After that PR, the first help screen from README.md looks like this:

           Approximate Pattern Matching GREP -- Get Regular Expression
Usage:
AGREP [-#cdehi[a|#]klnprstvwxyABDGIRS] [-f patternfile] [-H dir] pattern [files]
-#  find matches with at most # errors     -A  always output filenames
-b  print byte offset of match
-c  output the number of matched records   -B  find best match to the pattern
-d  define record delimiter                -Dk deletion cost is k
-e  for use when pattern begins with -     -G  output the files with a match
-f  name of file containing patterns       -Ik insertion cost is k
-h  do not display file names              -Sk substitution cost is k
-i  case-insensitive search; ISO <> ASCII  -ia ISO chars mapped to lower ASCII
-i# digits-match-digits, letters-letters   -i0 case-sensitive search
-k  treat pattern literally - no meta-characters
-l  output the names of files that contain a match
-n  print line numbers of matches          -q  print buffer byte offsets
-p  supersequence search                   -CP 850|437 set codepage
-r  recurse subdirectories (UNIX style)    -s  silent
-t  for use when delimiter is at the end of records
-v  output those records without matches   -V[012345V] version / verbose more
-w  pattern has to match as a word: "win" will not match "wind"
-u  suppress record output                 -x  pattern must match a whole line
-y  suppress the prompt when used with -B best match option
@listfile  use the filenames in listfile                              <1>23456Q
  • The -H option is mentioned in the one-line help but not in the detailed help.
  • The -b, -i0, -q, -CP codepage, and -V[012345V] options are mentioned in the detailed help but not in the one-line help.
  • The -g, -m, -o, -z, -L, -M, -O, and -P options are not documented anywhere in the help.
  • The -R option mentioned in the one-line help does not appear to exist (but is requested in missing (greplike) recursion -R #15). (How is this different from the -r option?)
  • The -d, -e, and -k options apparently require an argument which the help does not make obvious. (Compare with how the -f option is documented in the one-line help.)
  • The detailed help would be easier to navigate if it were sorted alphabetically by option (either case-sensitively or case-insensitively). It is currently somewhat alphabetical though with many deviations.
  • The detailed help would be easier to read if it were arranged either in a single column (my preference) or two columns (if compactness is valued more highly than legibility). The current mix of sometimes one-column and sometimes two-column, varying by line, requires more effort to understand.

If you don't want to fix this yourself, I or someone else might be able to submit a PR if you could describe the undocumented options and indicate which of the various alternatives you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant