Class: Toys::ToolDefinition::DefaultCompletion
- Inherits:
-
Completion::Base
- Object
- Completion::Base
- Toys::ToolDefinition::DefaultCompletion
- Defined in:
- core-docs/toys/tool_definition.rb
Overview
Defined in the toys-core gem
A Completion that implements the default algorithm for a tool.
Instance Attribute Summary collapse
-
#delegation_target ⇒ Array<String>?
Delegation target, or nil for none.
Instance Method Summary collapse
-
#call(context) ⇒ Array<Toys::Completion::Candidate>
Returns candidates for the current completion.
-
#complete_args? ⇒ Boolean
Whether to complete positional args.
-
#complete_flag_values? ⇒ Boolean
Whether to complete flag values.
-
#complete_flags? ⇒ Boolean
Whether to complete flags.
-
#complete_subtools? ⇒ Boolean
Whether to complete subtool names.
-
#include_hidden_subtools? ⇒ Boolean
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.
30 31 32 33 34 |
# File 'core-docs/toys/tool_definition.rb', line 30 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>?
Delegation target, or nil for none.
81 82 83 |
# File 'core-docs/toys/tool_definition.rb', line 81 def delegation_target @delegation_target end |
Instance Method Details
#call(context) ⇒ Array<Toys::Completion::Candidate>
Returns candidates for the current completion.
90 91 92 |
# File 'core-docs/toys/tool_definition.rb', line 90 def call(context) # Source available in the toys-core gem end |
#complete_args? ⇒ Boolean
Whether to complete positional args
64 65 66 |
# File 'core-docs/toys/tool_definition.rb', line 64 def complete_args? # Source available in the toys-core gem end |
#complete_flag_values? ⇒ Boolean
Whether to complete flag values
72 73 74 |
# File 'core-docs/toys/tool_definition.rb', line 72 def complete_flag_values? # Source available in the toys-core gem end |
#complete_flags? ⇒ Boolean
Whether to complete flags
56 57 58 |
# File 'core-docs/toys/tool_definition.rb', line 56 def complete_flags? # Source available in the toys-core gem end |
#complete_subtools? ⇒ Boolean
Whether to complete subtool names
40 41 42 |
# File 'core-docs/toys/tool_definition.rb', line 40 def complete_subtools? # Source available in the toys-core gem end |
#include_hidden_subtools? ⇒ Boolean
Whether to include hidden subtools
48 49 50 |
# File 'core-docs/toys/tool_definition.rb', line 48 def include_hidden_subtools? # Source available in the toys-core gem end |