read-editor-0.1.0.2: Opens a temporary file on the system's EDITOR and returns the resulting edits

Safe HaskellSafe
LanguageHaskell2010

System.ReadEditor

Contents

Synopsis

Main exports

readEditor :: IO String Source #

Opens a file in the sytem's editor and returns it's contents after it's saved.

readEditorWith :: String -> IO String Source #

Opens a file, fills it some content and returns it's contents after it's saved.

openEditor :: FilePath -> IO () Source #

Opens a file in the sytem's editor, waits until it's closed.

openEditorWithPrompt :: String -> FilePath -> IO () Source #

A version of openEditor which takes the fallback prompt question.

Utility

prompt :: String -> IO String Source #

Prompts for a line and returns it

withSystemTempFile :: String -> (FilePath -> Handle -> IO a) -> IO a Source #

Executes a function with an open temporary file Handle.