Usage
clop ls # run 'ls --help' and count its options
clop ls cp mv # several programs, plus a combined SUMMARY
clop --csv ls cp mv # machine-readable CSV
clop --list ls # also print the option names counted
ls --help | clop - # read help text from standard input
clop -f captured-help.txt # read help text from a saved file
Example output:
$ clop ls
ls
version 9.1
total options 60
with aliases 25
without aliases 35
short option names 40
long option names 45
What it reports
For each program, clop detects the version and prints five counts:
| Field | Meaning |
|---|---|
version | Program version, detected from program --version. |
total options | Distinct options (one per option line in the help). |
with aliases | Options with more than one spelling, e.g. -a / --all. |
without aliases | Options with exactly one spelling. |
short option names | Short forms counted, e.g. -a, -1. |
long option names | Long forms counted, e.g. --all, --block-size. |
The version matters: the same program can document a different number of options from one release to the next, so a count is only meaningful next to the version it was measured against.
Output formats
| Flag | Output |
|---|---|
| (default) | Human-readable report. |
--csv | name,version,total,with,without,short,long |
--tsv | The same columns, tab-separated. |
--no-header | Omit the header row in --csv / --tsv. |
--list | Additionally list the option names counted. |
Labelling sources
Reading from a file or stdin gives clop no program name or version to discover, so you can supply them yourself:
clop --name busybox -f busybox.help # label the source
clop --name tar --prog-version 1.35 -f tar.help # also record a version