Skip to content

completion

gapline completion <shell> [--install]

completion prints a shell completion script for gapline to stdout, or installs it into the shell’s standard completion directory when --install is passed.

Completion covers:

  • Every sub-command and its flags.
  • The 17 CRUD targets (stops, routes, trips, …).
  • Rule IDs, dynamically suggested from the rules registered with this build — useful for --disable-rule.
ArgumentValues
<shell>bash, zsh, fish, elvish, powershell.
FlagShortDescription
--installInstall the generated script into the shell’s standard completion directory instead of writing it to stdout. Supported for bash, zsh, and fish.

Global flags are listed on reference/global-flags.

Terminal window
gapline completion bash
gapline completion zsh
gapline completion fish
gapline completion elvish
gapline completion powershell
Terminal window
gapline completion bash --install
gapline completion zsh --install
gapline completion fish --install

Restart your shell or source the new file to pick up the completions.

If --install is not available for your shell (or you prefer an explicit path), redirect the generated script yourself:

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
  • Nothing completes after install. Most shells load completion scripts on startup. Open a new terminal or source the new file.
  • zsh reports “_arguments:comparguments:327: can only be called from completion function”. Make sure compinit runs in your .zshrc before the completion file is sourced.
  • Rule IDs do not complete. The dynamic rule-ID completer needs the binary on your PATH. Verify with gapline --version.
CodeMeaning
0Script generated or installed successfully.
3Installation failed (permission denied, directory not writable).

See concepts/exit-codes for the complete table.