Skip to content

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.

Terminal window
gapline completion bash --install

Open a new terminal or source ~/.bashrc to pick up the completion.

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.

Terminal window
gapline completion bash > ~/.local/share/bash-completion/completions/gapline
gapline completion zsh > "${fpath[1]}/_gapline"
gapline completion fish > ~/.config/fish/completions/gapline.fish
  • Subcommandsvalidate, 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.
Terminal window
gapline valid<Tab> # → validate
gapline validate --m<Tab> # → --min-severity
gapline validate --disable-rule bloc<Tab># block_id_trip_overlap
gapline read sto<Tab> # → stops stop-times
  • 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:comparguments error. compinit needs to run before the gapline completion is sourced. Check that your .zshrc calls autoload -Uz compinit && compinit before any plugin manager that sources custom completions.
  • Rule IDs do not suggest anything. The dynamic rule-ID completer shells out to the gapline binary. Run gapline --version to confirm the binary is on your PATH.