mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
rename to Format
This commit is contained in:
parent
13b676f392
commit
ac77ed1ba0
@ -34,7 +34,7 @@ import System.Environment
|
||||
data Format = Unified | Split | Patch
|
||||
|
||||
-- | The command line arguments to the application.
|
||||
data Arguments = Arguments { renderer :: Renderer, output :: Maybe FilePath, shaA :: String, shaB :: String, filepaths :: [FilePath] }
|
||||
data Arguments = Arguments { format :: Format, output :: Maybe FilePath, shaA :: String, shaB :: String, filepaths :: [FilePath] }
|
||||
|
||||
-- | A parser for the application's command-line arguments.
|
||||
arguments :: Parser Arguments
|
||||
@ -80,8 +80,8 @@ fetchFromGitRepo repoPath path sha = join $ withRepository lgFactory repoPath $
|
||||
return $ transcode bytestring
|
||||
|
||||
-- | Print a diff, given the command-line arguments, source files, and terms.
|
||||
printDiff :: Arguments -> FilePath -> (Source Char, Source Char) -> (Term T.Text Info, Term T.Text Info) -> IO ()
|
||||
printDiff arguments filepath (aSource, bSource) (aTerm, bTerm) = case renderer arguments of
|
||||
printDiff :: Arguments -> FilePath -> (Source Char, Source Char) -> (Term T.Text Info, Term T.Text Info) -> IO ()
|
||||
printDiff arguments filepath (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