1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00

Rename Renderer to Format

This is more consistent with the terminology around the command-line
`diff` tool.
This commit is contained in:
Matt Diephouse 2016-01-14 13:12:28 -05:00
parent 50422673b6
commit f0760188b9

View File

@ -24,10 +24,10 @@ import qualified Data.Text.ICU.Convert as Convert
import Data.Bifunctor.Join
-- | The available types of diff rendering.
data Renderer = Unified | Split | Patch
data Format = Unified | Split | Patch
-- | The command line arguments to the application.
data Arguments = Arguments { renderer :: Renderer, output :: Maybe FilePath, sourceA :: FilePath, sourceB :: FilePath }
data Arguments = Arguments { format :: Format, output :: Maybe FilePath, sourceA :: FilePath, sourceB :: FilePath }
-- | A parser for the application's command-line arguments.
arguments :: Parser Arguments
@ -53,7 +53,7 @@ main = do
-- | Print a diff, given the command-line arguments, source files, and terms.
printDiff :: Arguments -> (Source Char, Source Char) -> (Term T.Text Info, Term T.Text Info) -> IO ()
printDiff arguments (aSource, bSource) (aTerm, bTerm) = case renderer arguments of
printDiff arguments (aSource, bSource) (aTerm, bTerm) = case format arguments of
Unified -> do
rendered <- unified diff aSource bSource
B1.putStr rendered