mirror of
https://github.com/tmedwards/tweego.git
synced 2025-07-06 14:40:38 -04:00
ADD: Add JSON output (-j, --json
).
This commit is contained in:
parent
33a6da381c
commit
3a8dfb2344
8 changed files with 175 additions and 92 deletions
|
@ -64,6 +64,11 @@ func buildOutput(c *config) *story {
|
|||
|
||||
// Write the output.
|
||||
switch c.outMode {
|
||||
case outModeJSON:
|
||||
// Write out the project as JSON.
|
||||
if _, err := fileWriteAll(c.outFile, alignRecordSeparators(s.toJSON(c.startName))); err != nil {
|
||||
log.Fatalf(`error: %s`, err.Error())
|
||||
}
|
||||
case outModeTwee3, outModeTwee1:
|
||||
// Write out the project as Twee source.
|
||||
if _, err := fileWriteAll(c.outFile, alignRecordSeparators(s.toTwee(c.outMode))); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue