class
Jargon::Completion
- Jargon::Completion
- Reference
- Object
Overview
Shell completion: generates a small "shim" script per shell that, on every
Tab, forwards the cursor position and typed words to the program itself
(the hidden __complete verb). The program then computes candidates from
the schema plus any registered dynamic completers — so static (flags,
enums, subcommands) and dynamic (live app data) completion share one path.
Defined in:
jargon/completion.crConstant Summary
-
COMPLETE_VERB =
"__complete" -
Hidden subcommand the generated shim invokes at completion time. Never written by the developer — it is an internal token between the shim and CLI#handle_completion.
Constructors
Instance Method Summary
- #bash(command : String) : String
-
#candidates(words : Array(String), cword : Int32) : Array(String)
Compute completion candidates for a tokenized command line.
- #fish(command : String) : String
- #zsh(command : String) : String
Constructor Detail
Instance Method Detail
Compute completion candidates for a tokenized command line. words
includes the program name at index 0; cword is the index of the word
under the cursor (may equal words.size when completing a fresh token).