         }
     case "-json":
         delegate.once = true
-        delegate.format = "{\"latitude\":%latitude, \"longitude\":%longitude}"
+        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  \"address\": \"%address\"")
+        delegate.format.append("\n}")
     default:
         break
     }

        print("     %%v_accuracy  Vertical accuracy (meters)")
        print("     %%time        Time")
        print("     %%address     Reverse geocoded location to an address")
        print("  -json            Use the format {\"latitude\":%latitude, \"longitude\":%longitude}")
        print("                   Also implies -once")
        print("")
        print("  Default format if unspecified is: %%latitude %%longitude")

        var output = self.format
        output = output.replacingOccurrences(of: "%latitude", with: String(format: "%0.6f", location.coordinate.latitude))
        output = output.replacingOccurrences(of: "%longitude", with: String(format: "%0.6f", location.coordinate.longitude))
        output = output.replacingOccurrences(of: "%altitude", with: String(format: "%0.2f", location.altitude))
        output = output.replacingOccurrences(of: "%direction", with: "\(location.course)")
        output = output.replacingOccurrences(of: "%speed", with: "\(Int(location.speed))")
        output = output.replacingOccurrences(of: "%h_accuracy", with: "\(Int(location.horizontalAccuracy))")
