toosuto-r / qchat

KDB+ end-to-end RSA encrypted chat fun
8 stars 3 forks source link

Generic "help" function #34

Open jonathonmcmurray opened 6 years ago

jonathonmcmurray commented 6 years ago

In #30 and #31 we've been discussing the idea of re-working workers a bit so that they will be a single script each & call an "add api" type function on the main process to provide a function & worker name etc. (so that everything is contained within one script per worker)

Was thinking it might be good to also pass a help message to this "add api" function, and have a generic help function e.g.

q)\hp bc
BITCOIN BOT HELP
Usage: \bc <cur/opt> [amt].
Specify a currency to get current value of 1BTC in currency. Optionally include an amount to convert that amount of BTC to given currency.
Alternativley, supply an option (i.e. "plot") for different action e.g. \bc plot
Supported currencies: gbp,usd,eur,kfc. Options: plot [month|today|yday] (default: month)
q)\hp ml
music lookup from lastfm enabled, available options:
* enter 'user=<LFM_NAME>' to update lastfm username, leave blank to unset
* usage, where {} indicates optional parameters:
  * top: '\ml <USER>{&<FILTER>{&<PERIOD>}}'
  * chart: '\ml chart{&<USER>}{&<FILTER>}{&plot}'
  * scrobbles: '\ml scrobbles{&<USER>}'
* Filters: tracks, artists, albums
* Periods: overall, 7day, 1month, 3month, 6month, 12month
* users: mmcann, jmcmurray, tsmyth, squigley, clogan

At the moment some, but not all, commands output these types of messages when called with no param - might be more clear if there were a specific "help" function that could then be called on ANY function, with a help string for every function available - kinda like man for linux commands

jonathonmcmurray commented 6 years ago

Potentially an agreed-upon format for the help strings could give some nice consistency, but may be constrictive

jonathonmcmurray commented 6 years ago

https://github.com/toosuto-r/qchat/wiki/Guidelines-for-bots-%5BPROPOSED%5D