progrium/dokku — pull request #592 by stuartpb (2014-05-28 10:26:25+00:00)
Title: Refactor core into plugins with command and subcommand scripts

This change makes the mapping of plugins to commands in Dokku significantly more consistent, giving each existing Dokku command its own plugin, and each plugin a dedicated location for a provided command and/or subcommands.

Beyond the navigational advantages, this allows individual commands / components of Dokku to be disabled or overridden without having to muck around patching scripts that provide other commands.

## Commands and subcommands

"command" scripts, like a hook, are executed when the name of a plugin is
called: for instance, "dokku build" calls the "build" plugin's "command"
script.

"subcommand" scripts are called for subcommands of plugins, as namespaced with
a colon: for example, "dokku backup:export" calls the "export" subcommand
script of the "build" plugin.

Plugins that do not use their name for commands/subcommands (such as plugins that wrap other commands) can continue to use the "commands" hook, which remains fully supported and backwards-compatible.

## Updates to documentation

Each plugin / command gets a README describing its purpose and implementation.

Additionally, the "help" text describing its commands' usage is moved out to a separate "help.txt" file, which is then read and (potentially) columnized when running the "help" command.

This commit also removes the "warning" in the plugins directory - Dokku's stability, hooks and all, is
covered by the main Dokku README.

## Miscellany

This commit also removes the nginx-vhosts plugin's empty "commands" hook script, for clarity and cleanliness.

(This is effectively a resubmission of #458, as it was remade after taking #312 into account, rebased onto the current master.)