Open oubiwann opened 10 years ago
Thoughts on technical tasks:
src/lfetool-registry.lfe
moduleorddict
accessible a process that receives messages
register
function that will provide the registry with enough information to do its jobregister
function in them to populate the registry with scanned data (this should be done in (lfetool:init)
)With the latest changes committed (and pushed), here's the current output of lfetool commands
:
Help for lfetool built-in top-level commands:
commands - List all the top-level commands available to lfetool.
extract - lfetool is no longer compressed; this is a no-op (included for
backwards compatibility only).
help - Get the general help for lfetool; if passed a plugin name as
an argument, display the help for that plugin.
info - Get information of the type indicated by the passed argument.
install - Install LFE by default; if passed an argument, in stall the
indicated software.
repl - By default, start an LFE REPL with access to all the
dependency modules; if passed an argument, start a REPL of
that particular type.
new - Create new LFE projects with related files pre-populated with
code.
tests - Perform the tests-related action for the given argument.
update - Update the system/software associated with the given argument.
usage - Get lfetool usage.
version - Get the current version of lfetool and associated systems.
User-provided top-level commands:
whiggity - Do something crazy.
whack - Do something even crazier.
Use Case: Help Text
This is a sub-ticket of issue #50, as it will inform the decisions around creating a plugin system.
First possible use case for a plugin system (registry, really):
lfetool
needs to display:(lfetool-inspect:get-all-commands)
)To accomplish support of that third point, we would need a mechanism such that:
Each plugin might support a
new
command. For instance, thescript
andyaws
plugin will each have anew
function that will be called in the event of one of the following commands being issued:lfetool new script <name>
orlfetool new yaws <name>
Example Scenario
However, when listing all commands, e.g.,
lfetool commands
, we would want to see not the plugins, but just the supported commands and what they mean generally, e.g.:Registry Questions
If we had a registry, what might a plugin/command need to register ... what, exactly? (what's the minimum amount of information necessary to identify and then call any given "plugin behaviour" function in any given plugin module?
Default
lfetool
commands would be obtained bylists:usort
ing all the commands each lfetool plugin supported.Likewise for user commands, filtering on plugins where type="user" (or "custom"?).
Summary
In summary,
lfetool
needs: