1
1
mirror of https://github.com/github/semantic.git synced 2024-11-23 16:37:50 +03:00

Plumb in cmd line option for new toc output format

This commit is contained in:
Timothy Clem 2017-01-23 10:49:48 -08:00
parent f8ecbf9286
commit 02f87738c0
3 changed files with 4 additions and 2 deletions

View File

@ -48,6 +48,7 @@ library
, Renderer.Split
, Renderer.Summary
, Renderer.SExpression
, Renderer.TOC
, SemanticDiff
, SES
, Source

View File

@ -20,7 +20,7 @@ data DiffArguments = DiffArguments { format :: Format, output :: Maybe FilePath
data Format = Split | Patch | JSON | Summary | SExpression | TOC
deriving (Show)
data Output = SplitOutput Text | PatchOutput Text | JSONOutput (Map Text Value) | SummaryOutput (Map Text (Map Text [Value])) | SExpressionOutput Text | TOCOutput [Map Text Value]
data Output = SplitOutput Text | PatchOutput Text | JSONOutput (Map Text Value) | SummaryOutput (Map Text (Map Text [Value])) | SExpressionOutput Text | TOCOutput (Map Text (Map Text [Value]))
deriving (Show)
-- Returns a key representing the filename. If the filenames are different,

View File

@ -51,7 +51,8 @@ argumentsParser = info (version <*> helper <*> argumentsP)
<|> flag R.Split R.JSON (long "json" <> help "output a json diff")
<|> flag' R.Split (long "split" <> help "output a split diff")
<|> flag' R.Summary (long "summary" <> help "output a diff summary")
<|> flag' R.SExpression (long "sexpression" <> help "output an s-expression diff tree"))
<|> flag' R.SExpression (long "sexpression" <> help "output an s-expression diff tree")
<|> flag' R.TOC (long "toc" <> help "output a table of contents diff summary"))
<*> optional (option auto (long "timeout" <> help "timeout for per-file diffs in seconds, defaults to 7 seconds"))
<*> optional (strOption (long "output" <> short 'o' <> help "output directory for split diffs, defaults to stdout if unspecified"))
<*> switch (long "no-index" <> help "compare two paths on the filesystem")