wp-cli/wp-cli — pull request #524 by scribu (2013-06-16 11:42:51+00:00)
Title: Introduce WP_CLI::load_wordpress()

Having a function that you can call would simplify the logic quite a bit, particularly for `wp help`:

```php
class Help_Command {

function __invoke( $args ) {
$command = find_subcommand( $args );
if ( !$command ) {
WP_CLI::load_wordpress();
}

if ( !$command ) {
WP_CLI::error( "Can't find {$args[0]} command." );
}

// do stuff with $command
}
}
```

It would also help with early commands: #453.

Can copy the logic from the official unit test framework, which needs to solve the same problem.