Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2003:
[Freeciv-Dev] Re: (PR#6587) stdinhand.c auto-completion
Home

[Freeciv-Dev] Re: (PR#6587) stdinhand.c auto-completion

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#6587) stdinhand.c auto-completion
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Oct 2003 05:41:35 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Raimar Falke wrote:
> On Tue, Oct 21, 2003 at 01:48:49PM -0700, Jason Short wrote:
> 
>>The stdinhand auto-completion is unnecesarily complex, IMO.  Currently 
>>for instance there is an array listing which commands have, as their 
>>first parameter, a player name.  For each auto-completion we iterate 
>>over every entry in this list to see if (1) we are using this command 
>>and (2) this is the first parameter of that command.  If this check 
>>passes, we use the player list (via a function returning the player list 
>>autocompletion list) for autocompletion, if not we go on to the next 
>>type of autocompletion.
>>
>>Not only is this really inefficient (probably a non-issue), the data's 
>>just so spread out it's hard to keep things updated [1].  Instead I 
>>think 'struct command' should have an entry which is just the 
>>autocomplete function for the first parameter of that command (in the 
>>case of players: player_generator).  This also generalizes better to 
>>allowing autocompletion of commands other than the first [2] (which 
>>would currently require an entirely new, added infrastructure).
>>
>>[1] For instance the first parameter of /team should use 
>>player_generator, but nobody thought to update the array.  What other 
>>commands are misconfigured?
>>
>>[2] Like the second parameter of /team, which should use team_generator 
>>(currently there is no team_generator).
> 
> 
> While you may be right I haven't seen this as an issue yet because the
> rate at we change something in stdinhand.c i.e. add commands it quite
> low.

True.  However, if we were to add auto-completion of second parameters 
(e.g., the <team> paramater of /teams) it should probably be fixed 
first.  In the meantime, I'd like to welcome anyone to look into it.

jason




[Prev in Thread] Current Thread [Next in Thread]