You'd have to have the completion function parse the line "so far" so  
you'd have it match against commands until there was only one command  
to match ("mplayer") then match completions against file names,  
returning options concatenating the command and file name options.

-Brian

On Aug 11, 2005, at 11:00 AM, Bill Atkins wrote:

> I do.  I have the basics of readline working; I'm just trying to
> figure out how to complete input differently based on already entered
> commands.
>
> An analogy would be shell completion.  You type "mpla [TAB]" and
> "mplayer" gets completed, but any subsequent completion is for paths
> only.
>
> On 8/11/05, James Edward Gray II <james / grayproductions.net> wrote:
>
>> On Aug 11, 2005, at 9:44 AM, Bill Atkins wrote:
>>
>>
>>> How can I use the builtin readline library to complete arguments to
>>> commands?  I have basic completion working now, so that
>>>
>>> %wmi > st [TAB]
>>>
>>> will show valid commands starting with "st" (in this case "start"  
>>> and
>>> "stop"), but how do I complete arguments specific to that command?
>>>
>>
>> Do you have a Pickaxe (second edition)?  It's demoed on the page for
>> the Readline library.
>>
>> Let me know if you don't and I'll post an example...
>>
>> James Edward Gray II
>>
>>
>>
>>
>
>
> -- 
> Bill Atkins
>
>
>