Trejkaz wrote:
On Thu, Jan 1, 2009 at 3:25 AM, Richard S. Hall <[email protected]> wrote:
p.s. There is a difference between command API and things like command
completion and history. The former deals with core capabilities, while the
latter deals with UI issues. The core shouldn't assume a UI. Sometimes it
seems that people lump these two together.
Command completion, yes. Parameter completion (which is what normal
shell users expect these days), no. Take the following:
ls --<tab>
How can the shell determine the list of possible completions?
#1: Have a method where you pass the current String[] and the partial
input for the next parameter, and it returns an array of possible
completions for the parameter.
#2: Add semantics for commands so that a command can be interrogated
for its list of flags and the type of its arguments.
It's not like this is useful only from a real console. If #2 were
implemented then a web page would be able to generate a pretty form
for executing a command, instead of the user having to type out the
string. :-)
Granted some shell interfaces won't have a way to complete (command
via instant message for instance.) So maybe this sort of rich shell
command needs to be a sub-interface.
For me parameter completion is still part of the shell UI, not part of
the core shell API. The core shell API has to be defined in such a way
to make some of these features possible; for example, if the shell API
has no way to list available commands, then there is no way to do
command completion.
Perhaps we are suffering from a terminology issue here, since normally
when we say "shell" we think of something that both reads input from the
user and executes the commands. For our scenario, we have broken this in
half: one half executes commands and the other half reads input from the
user (and somehow delegates to the other half). I am calling that first
part the shell and the second part the shell UI.
-> richard
TX
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]