Method: Boxen::Autocomplete.complete
- Defined in:
- lib/boxen/autocomplete.rb
.complete(typed) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/boxen/autocomplete.rb', line 11 def complete(typed) if part = after(typed, SERVICE_OPTIONS) available_services.select { |s| s.start_with?(part) } elsif after(typed, DIR_OPTIONS) [] else OPTIONS.select { |o| o.start_with?(typed[/([a-z-]*)$/,1].to_s) } end end |