wp-cli/wp-cli — pull request #468 by scribu (2013-05-23 11:28:07+00:00)
Title: load path from --require before WP is loaded

If `--require` loads before WP, then internal commands should also load before WP and vice-versa.

Current workflow:

1. parse arguments
1. load WP
* load commands defined in plugins
1. `require "php/commands/$cmd.php"` or the path from `--require`
1. run command or fail if it's not registered

Proposed workflow:

1. parse arguments
1. `require "php/commands/$cmd.php"` or the path from `--require`
1. load WP
* load commands defined in plugins
1. run command or fail if it's not registered

This alone would fix #335.

It would also allow defining an API such as this:

```
WP_CLI::add_command( 'db', 'DB_Command', array(
'when' => 'after_load-wp-config'
) );
```