class Jargon::Completion

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.cr

Constant 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

Constructor Detail

def self.new(cli : CLI) #

[View source]

Instance Method Detail

def bash(command : String) : String #

[View source]
def candidates(words : Array(String), cword : Int32) : Array(String) #

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).


[View source]
def fish(command : String) : String #

[View source]
def zsh(command : String) : String #

[View source]