mirror of
https://github.com/github/semantic.git
synced 2024-12-25 16:02:43 +03:00
diff functions take tuples of sources now
This commit is contained in:
parent
99f8fb18a4
commit
263ea09dd2
@ -51,10 +51,10 @@ main = do
|
|||||||
printDiff :: Arguments -> (Source Char, Source Char) -> (Term T.Text Info, Term T.Text Info) -> IO ()
|
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 renderer arguments of
|
||||||
Unified -> do
|
Unified -> do
|
||||||
rendered <- unified diff aSource bSource
|
rendered <- unified diff (aSource, bSource)
|
||||||
B1.putStr rendered
|
B1.putStr rendered
|
||||||
Split -> do
|
Split -> do
|
||||||
rendered <- split diff aSource bSource
|
rendered <- split diff (aSource, bSource)
|
||||||
case output arguments of
|
case output arguments of
|
||||||
Just path -> do
|
Just path -> do
|
||||||
isDir <- doesDirectoryExist path
|
isDir <- doesDirectoryExist path
|
||||||
@ -63,7 +63,7 @@ printDiff arguments (aSource, bSource) (aTerm, bTerm) = case renderer arguments
|
|||||||
else path
|
else path
|
||||||
IO.withFile outputPath IO.WriteMode (write rendered)
|
IO.withFile outputPath IO.WriteMode (write rendered)
|
||||||
Nothing -> TextIO.putStr rendered
|
Nothing -> TextIO.putStr rendered
|
||||||
Patch -> putStr $ PatchOutput.patch diff aSource bSource
|
Patch -> putStr $ PatchOutput.patch diff (aSource, bSource)
|
||||||
where diff = interpret comparable aTerm bTerm
|
where diff = interpret comparable aTerm bTerm
|
||||||
write rendered h = TextIO.hPutStr h rendered
|
write rendered h = TextIO.hPutStr h rendered
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user