suggestion for a SLang interface for the RFC2229 Dict protocoll

General

Commands

DEFINE database word:
--> dict_define(word, database, host);
MATCH database strategy word:
--> dict_match(word, strategy, database, host)
SHOW:
--> dict_show(what, host)

Arguments

All arguments are strings

word:

search term, can be also a string of more than one word

database:

comma separated list of databases

use dict_show("db", host) to get a list of valid database names

host:

URL of the host, may contain the port appended after colon e.g. "localhost", "dict.org", "dict.example.org:3343"

strategy:

use dict_show("strat", host) to get valid values

what:

one of "db", "strat", "server", "info:<db>"

Return value

The slang functions should insert the result of the command into the current buffer.

This is the easiest way for the command line interface, otherwise I would need to insert the command, read it to a string and pass upwards (only to be eventually re-inserted by the calling fun))

An alternative is: return response as string

Preferabely format the response similar to the dict command line program.

Commands not needed in the basic version

CLIENT text STATUS HELP % is this needed? Possibly use dict_show("help") QUIT OPTION AUTH username authentication-string SASLAUTH