From: Robert Klemme Date: 2011-11-15T18:00:21+09:00 Subject: Re: Autocompletion of commands & arguments On Tue, Nov 15, 2011 at 5:17 AM, Sophie wrote: > I want to build a Ruby app with the following broad properties > > - Has some graph of objects, with a root R > - each object (including R) has some methods, m > - each m on each object has some args A > - each A has a set of valid candidates values, defined by method > candidates_A_m > - the objects have (string) names > > I want to build a command-line interface which lets me: > > - start at the root R > - invoke methods by typing in a prefix and using TAB > - choose arg values by typing in object-name prefix and TAB > - getting autocompletion or suggestion-list whenever possible > - change my "working" location in the graph (like "cd") & continue > > I have not used Ruby in some time. Am looking for any suggestions on useful > classes / libraries / methods / apps I should consider to make my life > easier :-) I haven't worked with it yet but I am almost 100% certain that you at least want to take a look at "readline". $ ri19 Readline $ gem19 list -b readline Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/