Repository navigation
feat: xcind — standalone dispatcher with full tab completion - #96
Merged
Merged
Conversation
Add bin/xcind, a minimal exec-only dispatcher: `xcind compose ...` runs `xcind-compose ...`, `app` aliases `application`, and every remaining argument passes through verbatim. No libraries are sourced on the dispatch path, so the dispatcher adds no startup cost; only --version sources the lib for the build-provenance string. Completion covers both shells. New top-level functions complete the command word at `xcind <TAB>`, then re-seat COMP_WORDS/COMP_CWORD (bash) or words/CURRENT (zsh) and delegate to the existing per-command functions, which never read word 0. Dynamic completion carries through: `xcind run fr<TAB>` completes declared bin/script names, and `xcind compose <TAB>` keeps Docker's full Cobra completion including service names. Register the new binary in all seven install manifests. Repoint flake.nix mainProgram from xcind-compose to xcind, so `nix run` now lands on the dispatcher help (behavior change for nix run users). The Docker ENTRYPOINT stays xcind-compose.
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
A standalone
xcindbinary that dispatches to the existingxcind-*commands, with full tab completion in bash and zsh.xcind compose up -dis exactlyxcind-compose up -d; every remaining argument passes through verbatim viaexec.appaliasesapplication, mirroring thexcind-appsymlink.xcind <TAB>completes the command word. After the command, completion delegates to the existing per-command functions, soxcind run fr<TAB>completes declared bin/script names andxcind compose <TAB>keeps Docker's full Cobra completion, including service names.How
The dispatcher is exec-only. It sources no libraries on the dispatch path, so it adds no startup cost. Only
--versionsources the lib for the build-provenance string.The completion functions work by re-seating the word arrays. The per-command functions key off word positions and never read the command name at word 0 (this already powers the
x-*wrappers), so the new top-level function shiftsCOMP_WORDS/COMP_CWORD(bash) orwords/CURRENT(zsh) by one and delegates. The seven existing functions are untouched.Behavior change
flake.nixmainProgramnow points atxcind, sonix runlands on the dispatcher help instead ofxcind-compose. The DockerENTRYPOINTstaysxcind-compose, so existingdocker runinvocations keep working.Testing
test/test-xcind.sh: help, version, unknown-command exit code, and byte-for-byte passthrough equality against direct invocations.test/test-xcind-completion.shfor both shells, driven through the samecomp_run/zsh-driver harness as the existing suites, including docker-gated proofs of compose service-name delegation and dynamic run-name completion against a real fixture.make checkpasses: lint clean, 2,280 assertions, 0 failures.contrib/check-file-manifestandnix flake checkpass.