Refactor
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
parent
a28e1cb7a0
commit
4d11b5354c
5 changed files with 33 additions and 25 deletions
|
@ -27,11 +27,11 @@ If -j or --json is added, the results will be in JSON format.`,
|
|||
|
||||
zets := zet.SearchZets(args[0])
|
||||
|
||||
zetList := zet.CreateZetList(zets)
|
||||
|
||||
result := zetList.Parse()
|
||||
|
||||
if jsonOutput {
|
||||
zetList := zet.CreateZetList(zets, false)
|
||||
|
||||
result := zetList.Parse()
|
||||
|
||||
json, err := json.AsJSON(result)
|
||||
|
||||
if err != nil {
|
||||
|
@ -40,6 +40,10 @@ If -j or --json is added, the results will be in JSON format.`,
|
|||
|
||||
fmt.Println(json)
|
||||
} else {
|
||||
zetList := zet.CreateZetList(zets)
|
||||
|
||||
result := zetList.Parse()
|
||||
|
||||
fmt.Println(strings.Join(result, "\n"))
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue