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.



219
220
221
# File 'core-docs/toys/flag.rb', line 219

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:



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

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

#include_long?Boolean

Whether to include long flags

Returns:

  • (Boolean)


235
236
237
# File 'core-docs/toys/flag.rb', line 235

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

#include_negative?Boolean

Whether to include negative long flags

Returns:

  • (Boolean)


243
244
245
# File 'core-docs/toys/flag.rb', line 243

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

#include_short?Boolean

Whether to include short flags

Returns:

  • (Boolean)


227
228
229
# File 'core-docs/toys/flag.rb', line 227

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