1

In the manual page of command find,
I found options of -depth, -delete, -exec and etc their leading symbol are single - instead of a double as --

Conversely, there's git log --oneline , git log --graph, and --python,
which are facile to distinguish the full names and abbreviated commands

Why does command find not follow such a practice.

don_crissti
  • 82,805
Wizard
  • 2,503
  • Those are not options. Read the manual to learn the difference between options and expressions (predicates, primaries, whatever...) – don_crissti Mar 27 '18 at 10:26

1 Answers1

3

Because find is a utility standardized by POSIX and git is not. The git developers are therefore free to implement its options/operands in whatever way they see fit.

POSIX utilities use - to introduce options, and implementations of these utilities (such as ls etc.) always implement them the way the POSIX standard prescribes. Then, for some utilities, there is an additional "long option" variant of some standard options along with extensions that are not even mentioned by POSIX.

In the case of find, these are not strictly "options" but "operands" (also referred to as "primaries" or "predicates" depending on what manual you're reading) that form "operand expressions" and act on the pathname that find is currently processing. The real options of standard find are just -H (dereference symbolic links) and -L (do not dereference symbolic links). You will notice the difference in the manual where options and operands are divided into separate sections.

Also for git, these are not "true option" when specified on the command line the way that it's done in the question, but operands. Options are always specified before non-options, and any command line arguments after the last option are just "operands". They may well be translated to true options for the sub-command that git invokes later though.

Kusalananda
  • 333,661