Repository navigation
feat(run): fall through to docker compose subcommands - #97
Merged
Merged
Conversation
A name given to xcind-run that matches no declared bin or script, but is a known docker compose top-level subcommand (static list), now runs `docker compose … <name> <args…>` with the app's resolved options — `x-run up` works next to `x-run reup`. - Declared bins and scripts take precedence; @compose bypasses a shadow. - -T does not apply; args are forwarded verbatim, like @compose. - Step-level @refs inside scripts do not fall through; a .xcind.sh typo still fails loudly. - --list gains a compose: section above bins:; --names is unchanged. - Completion: bash offers compose subcommands once a prefix is typed (bare TAB stays bins/scripts only); zsh shows them as their own labeled group; after a compose name both shells re-seat into the compose completion, so Docker's Cobra protocol completes flags and service names. - A drift guard keeps the passthrough word list identical across the runner library and both completion scripts. The compose fallback lists stay narrow on purpose: the delegation tests prove Cobra delegation with words the fallback lacks (ls, watch, cp).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
xcind-run <name>(andx-run <name>) now falls through todocker compose <name> <args…>when the name matches no declared bin or script but is a known compose top-level subcommand.x-run upnow works next tox-run reup, with the app's resolved compose options.Behavior
x-run tsetkeeps the clear xcind error and exit 1.upshadows composeup;@compose upbypasses the shadow.-Tdoes not apply on the fallthrough. Args go todocker composeverbatim, exactly like@compose.@refsinside scripts do not fall through, so a.xcind.shtypo still fails loudly.xcind-run --listopens with acompose:section abovebins:.--list --namesstays bins and scripts only, so--init-shellwrappers are unchanged.Completion
x-run <TAB>shows only the project's bins and scripts. A typed prefix (x-run u<TAB>) adds matching compose subcommands. bash readline cannot group, so prefix gating keeps the bare list quiet.x-run up <TAB>), both shells re-seat into the compose completion. Docker's Cobra protocol then completes flags and service names.Tests
-Tignored, precedence/shadowing, unchanged error paths,--listsection order.x-runwrapper case, and a drift guard that keeps the passthrough word list identical across the runner library and both completion scripts.__xcind_compose_fallbacklists stay narrow on purpose. The delegation tests prove Cobra delegation with words the fallback lacks (ls,watch,cp), so the fallback must not learn them.make checkpasses: lint clean, 270 tests, 0 failed. Smoke-tested inexamples/workspaceless/acmeapps:xcind-run psruns compose,--listshows the new section,xcind-run nosuchstill exits 1.Known limitation (pre-existing, shared with
xcind-compose): compose completion never injectsXCIND_DOCKER_COMPOSE_OPTS, so service-name completion can be empty when compose files live underXCIND_COMPOSE_DIR.