wp-cli/wp-cli — pull request #302 by goldenapples (2013-02-13 07:59:19+00:00)
Title: Introduce system editor function in \WP_CLI\Utils

This is a first pass at trying to address the rough outline of #287 - markdown support and more will have to come separately.

In my initial tests, this seems pretty stable across platforms as far as successfully creating the temp files, preserving the correct line endings and so on, but I have a lot more testing to do.

Does the rough approach look right, or do you see ways to make it more universal?

Adds a function called `launch_editor_for_input()` which launches the
system's editor to allow file editing of post content, etc. Should
account for system line-endings properly, but probably needs testing on
Windows to be sure. Function returns false if no change (ie user :q!'s
out of vim), or updated content if any change is made.

Also adds two new subcommands to `wp post`:
- `wp post create --edit`	Launches the editor to build the post
content before creating post.
- `wp post edit `	Edits post 's content in system editor.