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
|
@ -22,6 +22,7 @@ type outputMode int
|
|||
|
||||
const (
|
||||
outModeHTML outputMode = iota
|
||||
outModeJSON
|
||||
outModeTwee3
|
||||
outModeTwee1
|
||||
outModeTwine2Archive
|
||||
|
@ -132,6 +133,7 @@ func newConfig() *config {
|
|||
options.Add("format", "-f=s|--format=s")
|
||||
options.Add("head", "--head=s")
|
||||
options.Add("help", "-h|--help")
|
||||
options.Add("json", "-j|--json")
|
||||
options.Add("listcharsets", "--list-charsets")
|
||||
options.Add("listformats", "--list-formats")
|
||||
options.Add("logfiles", "--log-files")
|
||||
|
@ -164,6 +166,8 @@ func newConfig() *config {
|
|||
c.headFile = val.(string)
|
||||
case "help":
|
||||
usage()
|
||||
case "json":
|
||||
c.outMode = outModeJSON
|
||||
case "listcharsets":
|
||||
usageCharsets()
|
||||
case "listformats":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue