clop

Command-Line OPtions

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 from standard input
clop -f captured-help.txt    # read help 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

FieldMeaning
versionProgram version, 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, e.g. -a, -1.
long option namesLong forms, e.g. --all, --block-size.

The same program can list different options across releases, so a count only means something next to its version.

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.
--listAlso list the option names counted.

Labelling sources

A file or stdin has no program name or version to detect, so supply them:

clop --name busybox -f busybox.help               # label the source
clop --name tar --prog-version 1.35 -f tar.help   # also record a version