mirror of
https://github.com/github/semantic.git
synced 2024-12-24 15:35:14 +03:00
Rename Renderer to Format
This is more consistent with the terminology around the command-line `diff` tool.
This commit is contained in:
parent
50422673b6
commit
f0760188b9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user