Skip to content

Commit

Permalink
Make valid JSON output
Browse files Browse the repository at this point in the history
  • Loading branch information
fulldecent committed Jun 25, 2017
1 parent 57490d7 commit ca2c284
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions CoreLocationCLI/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ for (i, argument) in ProcessInfo().arguments.enumerated() {
case "-json":
delegate.follow = false
delegate.format = "{"
delegate.format.append("\n \"latitude\": %latitude")
delegate.format.append("\n \"longitude\": %longitude")
delegate.format.append("\n \"altitude\": %altitude")
delegate.format.append("\n \"direction\": %direction")
delegate.format.append("\n \"speed\": %speed")
delegate.format.append("\n \"h_accuracy\": %h_accuracy")
delegate.format.append("\n \"v_accuracy\": %v_accuracy")
delegate.format.append("\n \"time\": \"%time\"")
delegate.format.append("\n \"latitude\": %latitude,")
delegate.format.append("\n \"longitude\": %longitude,")
delegate.format.append("\n \"altitude\": %altitude,")
delegate.format.append("\n \"direction\": %direction,")
delegate.format.append("\n \"speed\": %speed,")
delegate.format.append("\n \"h_accuracy\": %h_accuracy,")
delegate.format.append("\n \"v_accuracy\": %v_accuracy,")
delegate.format.append("\n \"time\": \"%time\",")
delegate.format.append("\n \"address\": \"%address\"")
delegate.format.append("\n}")
default:
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ The default format is: `%%latitude %%longitude`.

>```json
>{
> "latitude": 40.141196
> "longitude": -75.034815
> "altitude": 92.00
> "direction": -1.0
> "speed": -1
> "h_accuracy": 65
> "v_accuracy": 10
> "time": "2017-06-25 05:29:38 +0000"
> "latitude": 40.141196,
> "longitude": -75.034815,
> "altitude": 92.00,
> "direction": -1.0,
> "speed": -1,
> "h_accuracy": 65,
> "v_accuracy": 10,
> "time": "2017-06-25 05:36:35 +0000",
> "address": "407 Keats Rd
>Lower Moreland PA 19006
>United States"
Expand Down

0 comments on commit ca2c284

Please sign in to comment.