No, this is bad UX. The asymmetry violates the principle of least surprise.
What --all conventionally means:
A flag like --all should modify the scope or filtering of output, not the fundamental preconditions for the command to execute. Users expect flags to be additive or parametric modifications to a base behavior.
Examples of expected behavior:
| Command | Without flag | With --all / -a |
|---|---|---|
ls vs ls -a |
Shows visible files | Also shows hidden files |
docker ps vs docker ps -a |
Shows running containers | Also shows stopped containers |
git branch vs git branch -a |
Shows local branches | Also shows remote branches |
In all these cases, the preconditions are identical—the flag just widens the filter.
The problem with zvm's behavior:
If zvm ls requires zig but zvm ls --all doesn't, then --all is secretly switching between two fundamentally different operations:
- One queries the local zig installation
- One queries some remote/available versions list
These should arguably be separate commands (e.g., zvm ls vs zvm ls-remote or zvm available), or the base command should work without zig and show local installs as a subset marked differently.
Your framing is correct: this is a good "narrowest point" to anchor the design discussion because resolving it forces clarity about what ls fundamentally does.