fix(functions): split dops.fish into dops and docker

dops.fish defined `docker`, not `dops`. dops was never defined; docker
was only conditionally defined as a side effect of the failed dops
autoload, so its behavior could silently change mid-session. See
JOB-BRIEF-FINDINGS.md §1.

- functions/dops.fish now defines dops: a real enhanced `docker ps`
  listing (custom Names/Image/Status/Ports table), with its own --help.
- functions/docker.fish is a new file holding the ps-redirect wrapper,
  fixed to actually call dops (previously called the still-undefined
  dops from inside itself).
- Bare `docker` with no arguments no longer falls through an
  if-with-no-else (the fish false-zero, AGENTS.md standing gotcha #5)
  and does nothing; it now runs the real docker binary, which prints
  its own usage.
- tests/functional.fish: updated the now-stale comment explaining why
  the help-flag check resolves the real function name instead of the
  file stem.
This commit is contained in:
2026-09-08 01:11:49 -04:00
parent f6ead99f48
commit 23420b3235
3 changed files with 61 additions and 18 deletions
+3 -2
View File
@@ -316,8 +316,9 @@ function test_every_user_facing_function_has_help
# Published == carries a `# CATEGORY` block, matching
# manualtools.parse_functions.
contains -- "# CATEGORY" (string trim -- $lines); or continue
# Resolve the real defined name; the file stem can disagree
# (dops.fish defines `docker` -- see JOB-BRIEF-FINDINGS.md §1).
# Resolve the real defined name; the file stem can disagree with it
# (formerly dops.fish defined `docker` -- see JOB-BRIEF-FINDINGS.md
# §1, fixed by splitting it into dops.fish and docker.fish).
set -l name (string match -rg '^\s*function\s+(\S+)' -- $lines)[1]
test -n "$name"; or continue
set name (string trim -c "'\"" -- $name)