lfe-deprecated / lfetool

DEPRECATED - See:
https://github.com/lfe-rebar3/
Other
61 stars 19 forks source link

Plugin System Internals: Help Text Use Case #73

Open oubiwann opened 10 years ago

oubiwann commented 10 years ago

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):

To accomplish support of that third point, we would need a mechanism such that:

Each plugin might support a new command. For instance, the script and yaws plugin will each have a new function that will be called in the event of one of the following commands being issued:

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.:

$ lfetool commands

commands - list all the top-level commands supported by lfetool
help     - get the general help for lfetool; if passed a plugin name as an argument,
           display the help for that plugin
new      - create new LFE projects with related files pre-populated with code
version  - display lfetool-related versioning information

Custom commands:

alice    - a special command for a custom workflow, written by Alice for her use only
bob      - some of a lark, but bob tends to use this command a bunch, so there
carol    - a super-useful command Carol's thinking about contributing back to lfetool

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 lfetoolcommands would be obtained by lists:usorting all the commands each lfetool plugin supported.

Likewise for user commands, filtering on plugins where type="user" (or "custom"?).

Summary

In summary, lfetool needs:

oubiwann commented 10 years ago

Thoughts on technical tasks:

oubiwann commented 10 years ago

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.