Class: Clian::Command::Completions
- Inherits:
-
Object
- Object
- Clian::Command::Completions
- Defined in:
- lib/clian/command/completions.rb
Instance Method Summary collapse
-
#initialize(help, global_options, arguments, &custom_completion_proc) ⇒ Completions
constructor
A new instance of Completions.
Constructor Details
#initialize(help, global_options, arguments, &custom_completion_proc) ⇒ Completions
Returns a new instance of Completions.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/clian/command/completions.rb', line 5 def initialize(help, , arguments, &custom_completion_proc) @help, @global_options, @arguments = help, , arguments @custom_completion_proc = custom_completion_proc command_name = arguments.find {|arg| arg !~ /^-/} print completion_header print possible_subcommands(help) if command_name and help[command_name] print arguments_spec(help[command_name]) print (help[command_name].) end print () end |