ronin-rb / ronin-core

A core library for all ronin libraries.
https://ronin-rb.dev
GNU Lesser General Public License v3.0
3 stars 3 forks source link

Add tab-completion support to Ronin::Core::CLI::Shell #12

Closed postmodern closed 2 years ago

postmodern commented 2 years ago

Add tab-completion support to Ronin::Core::CLI::Shell. It should be possible to tab-complete command names, as well as additional arguments/options for a command.

fo<TAB><TAB>
foo
foot
food

foo --b<TAB><TAB>
--bytes

This can be accomplished using Reline.completion_proc = ->(line) { ...}. Each command should also have an optional array of known completion values.

command :foo, usage: '[options]', summary: '...', completion: %w[--bytes --count -c ...]