clop

Command-Line OPtions

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:

FieldMeaning
versionProgram version, detected from program --version.
total optionsDistinct options (one per option line in the help).
with aliasesOptions with more than one spelling, e.g. -a / --all.
without aliasesOptions with exactly one spelling.
short option namesShort forms counted, e.g. -a, -1.
long option namesLong 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

FlagOutput
(default)Human-readable report.
--csvname,version,total,with,without,short,long
--tsvThe same columns, tab-separated.
--no-headerOmit the header row in --csv / --tsv.
--listAdditionally 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