cmd-help-sublime-syntax icon indicating copy to clipboard operation
cmd-help-sublime-syntax copied to clipboard

Scope usage lines

Open victor-gp opened this issue 2 years ago • 1 comments

In the work for #23, it became apparent that not handling usage lines blocks the handling other patterns.

In particular, most patterns that start with a subcommand (lowercase name), such as those reported in #3

It should be easy enough, here are some heuristics off the top of my head:

  • after section headings like "usage:" or "examples:"
  • first few lines at the beginning of the help message
  • stop handling them as usage lines after the first double break (two consecutive \n's)

victor-gp avatar Jul 31 '23 00:07 victor-gp

Some examples:

bat-usage

ruby-usage

cp-usage

git-usage

grep-usage

apt-usage

victor-gp avatar Jul 31 '23 01:07 victor-gp