clop

Command-Line OPtions

What clop reads

clop only knows two ways to obtain help text, plus one way to detect a version:

It doesHow
Run program --helpwhen you name a PROGRAM on the command line
Read help text from a fileclop -f FILE
Read help text from standard inputclop - (e.g. prog --help \| clop -)
Detect the version via program --versionautomatically, when you name a PROGRAM

That is the whole list of what is supported by clop. If a program prints one option per line, i.e., the layout used by GNU coreutils, BusyBox, and Toybox, then clop counts it well.

What clop does not support (yet)

clop is deliberately small, so several common "give me help" conventions are not attempted:

In short: clop reliably handles --help, -f FILE, and stdin for one-option-per-line layouts. Anything else, such as -h, man, info, subcommand trees, or unusual formatting, is not yet handled directly, but you can almost always feed it in manually with -f or -.

Security

Naming a program makes clop run program --help (and program --version to record its version), exactly as if you had typed them yourself. Therefore, only pass names of programs you trust. To analyze help text without running anything, capture it first and read it from a file or stdin:

untrusted --help > help.txt
clop -f help.txt

The script itself never passes your input to a shell, never uses eval, and treats help text strictly as text (shell glob characters in --help output are not expanded).