Skip to content

Commit

Permalink
README.rdoc updated list_actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rkumar committed Oct 6, 2011
1 parent 8af62a1 commit 101c095
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.rdoc
Expand Up @@ -72,6 +72,25 @@ Assuming a program "prog" with subcommands "del" and "add"

selected_command_name = opt_parse()

== Custom Completion
The command list_actions can be called from your application, so that the user
can have custom completion.

opts.on("--list-actions", "list actions for autocompletion ") do |v|
Subcommands::list_actions
exit 0
end

Now we can place something like this in a configuration file. Here's what i placed
in .zshrc for bugzyrb.

_bugzyrb() {
reply=(`bugzyrb --list-actions`)
}
compctl -K _bugzyrb bugzyrb

Now, on the command line when I type "bugzyrb <TAB>" the actions are prompted in a menu.

== Sample Output

$ ruby subcommand.rb help
Expand Down

0 comments on commit 101c095

Please sign in to comment.