Writing a CLI tool, I'm facing a conundrum.
The tool is supposed to detect faces in images and blur them automatically. However, sometimes only one of those things should be done to allow marking additional faces manually with an external tool. So there are three behaviours I want to support:
- Detect faces and blur them in one go
- Only detect faces
- Only blur faces
My idea of solving this were two mutually exclusive options, something like --only-detect
and --only-blur
.
However, a coworker suggested that it might make more sense to have --detect
and --blur
, so that using both options would lead to the same behaviour as using none, but I find this to be less intuitive.
My question now is: Are there any conventions I can follow to make this decision? I found the POSIX Utility Conventions, and they do mention mutually exclusive groups, but nothing that is helpful here.
--only-foo
is not something I think I've ever encountered in a tool; there's a few that do--no-foo
, and--no-blur --no-detect
wouldn't be mutually exclusive, nor would ` ` be the same as--blur --detect
.--no-blur --no-detect
?--action=blur
,--action=detect
and--action=both
and state that the default is--action=both
. Or just abbreviate those to--blur
,--detect
and--both
, so that no-one needs to complain about having to type too much... (of course, if you ever add any functions, the "both" option starts to seem odd.) But whatever you do, document the options and the default. Other than that, I think it's just up to you as the author.