Shell completion
Completion saves keystrokes on every gapline invocation. It suggests subcommands, flags, CRUD target names, and — unique to gapline — the IDs of every validation rule compiled into your build, so --disable-rule <Tab> becomes a menu instead of a grep-then-paste ritual.
Install in one command
Section titled “Install in one command”gapline completion bash --installOpen a new terminal or source ~/.bashrc to pick up the completion.
gapline completion zsh --installMake sure compinit runs in your .zshrc before any custom completion loader. Start a new shell or source ~/.zshrc.
gapline completion fish --installFish picks up the new file on the next prompt — no restart needed.
Install manually
Section titled “Install manually”When --install cannot reach the standard directory (read-only partition, unusual shell setup, a CI runner with no home), generate the script yourself and redirect it to the path that fits your environment.
gapline completion bash > ~/.local/share/bash-completion/completions/gaplinegapline completion zsh > "${fpath[1]}/_gapline"gapline completion fish > ~/.config/fish/completions/gapline.fishWhat gets completed
Section titled “What gets completed”- Subcommands —
validate,read,create,update,delete,run,rules,completion. - Flags — long forms (
--feed,--format,--min-severity…) and their short aliases (-f,-o,-w,-s). - CRUD targets — the 17 GTFS files accepted by
read,create,update,delete(stops,routes,trips,stop-times, …). - Validation rule IDs — every rule registered in the current binary, suggested as the value of
--disable-rule.
Try it
Section titled “Try it”gapline valid<Tab> # → validategapline validate --m<Tab> # → --min-severitygapline validate --disable-rule bloc<Tab># → block_id_trip_overlapgapline read sto<Tab> # → stops stop-timesTroubleshooting
Section titled “Troubleshooting”- Nothing happens on
<Tab>. Most shells load completion scripts at startup. Open a new terminal or source the file you just wrote. - Zsh prints a
_arguments:compargumentserror.compinitneeds to run before the gapline completion is sourced. Check that your.zshrccallsautoload -Uz compinit && compinitbefore any plugin manager that sources custom completions. - Rule IDs do not suggest anything. The dynamic rule-ID completer shells out to the
gaplinebinary. Rungapline --versionto confirm the binary is on yourPATH.
See also
Section titled “See also”gapline completionreference — full flag reference.gapline rules list— the same rule IDs that completion suggests.- Validating feeds — how
--disable-rulefits into a real workflow.