Class: Toys::Flag::DefaultCompletion

Inherits:
Completion::Base show all
Defined in:
core-docs/toys/flag.rb

Overview

Defined in the toys-core gem

A Completion that returns all possible flags associated with a Toys::Flag.

Instance Method Summary collapse

Constructor Details

#initialize(flag:, include_short: true, include_long: true, include_negative: true) ⇒ DefaultCompletion

Create a completion given configuration options.

Parameters:

  • flag (Toys::Flag)

    The flag definition.

  • include_short (boolean) (defaults to: true)

    Whether to include short flags.

  • include_long (boolean) (defaults to: true)

    Whether to include long flags.

  • include_negative (boolean) (defaults to: true)

    Whether to include --no-* forms.



230
231
232
# File 'core-docs/toys/flag.rb', line 230

def initialize(flag:, include_short: true, include_long: true, include_negative: true)
  # Source available in the toys-core gem
end

Instance Method Details

#call(context) ⇒ Array<Toys::Completion::Candidate>

Returns candidates for the current completion.

Parameters:

Returns:



265
266
267
# File 'core-docs/toys/flag.rb', line 265

def call(context)
  # Source available in the toys-core gem
end

#include_long?boolean

Whether to include long flags

Returns:

  • (boolean)


246
247
248
# File 'core-docs/toys/flag.rb', line 246

def include_long?
  # Source available in the toys-core gem
end

#include_negative?boolean

Whether to include negative long flags

Returns:

  • (boolean)


254
255
256
# File 'core-docs/toys/flag.rb', line 254

def include_negative?
  # Source available in the toys-core gem
end

#include_short?boolean

Whether to include short flags

Returns:

  • (boolean)


238
239
240
# File 'core-docs/toys/flag.rb', line 238

def include_short?
  # Source available in the toys-core gem
end