I would like to write a command line tool that passes some formatted text to whatever EDITOR the user has set in the environment and then reading the contents back.
How do tools like svn commit and git commit handle this behavior? Is there a standard pattern for doing this?