Class: Toys::ToolDefinition::DefaultCompletion
- Inherits:
-
Completion::Base
- Object
- Completion::Base
- Toys::ToolDefinition::DefaultCompletion
- Defined in:
- core-docs/toys/tool_definition.rb
Overview
A Completion that implements the default algorithm for a tool.
Defined in the toys-core gem
Instance Attribute Summary collapse
-
#delegation_target ⇒ Array<String>?
readonly
Delegation target, or nil for none.
Instance Method Summary collapse
-
#call(context) ⇒ Array<Toys::Completion::Candidate>
Returns candidates for the current completion.
-
#complete_args? ⇒ true, false
Whether to complete positional args.
-
#complete_flag_values? ⇒ true, false
Whether to complete flag values.
-
#complete_flags? ⇒ true, false
Whether to complete flags.
-
#complete_subtools? ⇒ true, false
Whether to complete subtool names.
-
#include_hidden_subtools? ⇒ true, false
Whether to include hidden subtools.
-
#initialize(complete_subtools: true, include_hidden_subtools: false, complete_args: true, complete_flags: true, complete_flag_values: true, delegation_target: nil) ⇒ DefaultCompletion
constructor
Create a completion given configuration options.
Constructor Details
#initialize(complete_subtools: true, include_hidden_subtools: false, complete_args: true, complete_flags: true, complete_flag_values: true, delegation_target: nil) ⇒ DefaultCompletion
Create a completion given configuration options.
44 45 46 47 48 |
# File 'core-docs/toys/tool_definition.rb', line 44 def initialize(complete_subtools: true, include_hidden_subtools: false, complete_args: true, complete_flags: true, complete_flag_values: true, delegation_target: nil) # Source available in the toys-core gem end |
Instance Attribute Details
#delegation_target ⇒ Array<String>? (readonly)
Delegation target, or nil for none.
94 95 96 |
# File 'core-docs/toys/tool_definition.rb', line 94 def delegation_target @delegation_target end |
Instance Method Details
#call(context) ⇒ Array<Toys::Completion::Candidate>
Returns candidates for the current completion.
103 104 105 |
# File 'core-docs/toys/tool_definition.rb', line 103 def call(context) # Source available in the toys-core gem end |
#complete_args? ⇒ true, false
Whether to complete positional args
78 79 80 |
# File 'core-docs/toys/tool_definition.rb', line 78 def complete_args? # Source available in the toys-core gem end |
#complete_flag_values? ⇒ true, false
Whether to complete flag values
86 87 88 |
# File 'core-docs/toys/tool_definition.rb', line 86 def complete_flag_values? # Source available in the toys-core gem end |
#complete_flags? ⇒ true, false
Whether to complete flags
70 71 72 |
# File 'core-docs/toys/tool_definition.rb', line 70 def complete_flags? # Source available in the toys-core gem end |
#complete_subtools? ⇒ true, false
Whether to complete subtool names
54 55 56 |
# File 'core-docs/toys/tool_definition.rb', line 54 def complete_subtools? # Source available in the toys-core gem end |
#include_hidden_subtools? ⇒ true, false
Whether to include hidden subtools
62 63 64 |
# File 'core-docs/toys/tool_definition.rb', line 62 def include_hidden_subtools? # Source available in the toys-core gem end |