feat(command): port dirname from just-bash
Strip the last component from each NAME. Mirrors GNU dirname
semantics as implemented by just-bash: trailing slashes are
collapsed before splitting, a name with no slash yields ".",
and a name whose only slashes are leading yields "/".
Signed-off-by: Xe Iaso <me@xeiaso.net>
Assisted-by: Claude Opus 4.7 via Claude Code