11# CoreLocationCLI
22
3- CoreLocationCLI gets the physical location of your device and prints it to standard output. If you move it will also print out your updated location. * Kill it with CTRL-C.*
3+ CoreLocationCLI gets the physical location of your device and prints it to standard output. If you move it can also print your updated location. * Kill it with CTRL-C.*
44
55![ Usage] ( https://cloud.githubusercontent.com/assets/382183/25063655/52c11234-221d-11e7-81fb-0f8712dac393.gif )
66
@@ -10,56 +10,72 @@ Note for Mac users: make sure WiFi is turned on. Otherwise you will see `kCLErro
1010
1111``` sh
1212CoreLocationCLI -h
13- CoreLocationCLI [-once] -json
14- CoreLocationCLI [-once ] [-verbose] [-format FORMAT]
13+ CoreLocationCLI -json
14+ CoreLocationCLI [-follow ] [-verbose] [-format FORMAT]
1515```
1616
17- | Switch | Description |
18- | ---------------- | ------------------------------------------------------ |
19- | ` -h ` | Display this help message and exit |
20- | ` -once ` | Print one location and exit |
21- | ` -verbose ` | Verbose mode |
22- | ` -json ` | JSON output mode |
17+ | Switch | Description |
18+ | ---------------- | ---------------------------------------- |
19+ | ` -h ` | Display this help message and exit |
20+ | ` -follow ` | Continually print location |
21+ | ` -verbose ` | Verbose mode |
22+ | ` -json ` | JSON output mode |
2323| ` -format FORMAT ` | Print a formatted string with the following specifiers |
2424
25- | Format | Description |
26- | -------------- | ---------------------------------------------- |
25+ | Format | Description |
26+ | -------------- | ---------------------------------------- |
2727| ` %%latitude ` | Latitude (degrees north; or negative for south |
28- | ` %%longitude ` | Longitude (degrees west; or negative for east |
29- | ` %%altitude ` | Altitude (meters) |
30- | ` %%direction ` | Degrees from true north |
31- | ` %%speed ` | Meters per second |
32- | ` %%h_accuracy ` | Horizontal accuracy (meters) |
33- | ` %%v_accuracy ` | Vertical accuracy (meters) |
34- | ` %%time ` | Time |
35- | ` %%address ` | Reverse geocoded location to an address |
28+ | ` %%longitude ` | Longitude (degrees west; or negative for east |
29+ | ` %%altitude ` | Altitude (meters) |
30+ | ` %%direction ` | Degrees from true north |
31+ | ` %%speed ` | Meters per second |
32+ | ` %%h_accuracy ` | Horizontal accuracy (meters) |
33+ | ` %%v_accuracy ` | Vertical accuracy (meters) |
34+ | ` %%time ` | Time |
35+ | ` %%address ` | Reverse geocoded location to an address |
3636
37- The default format if unspecified is: ` %%latitude %%longitude ` .
37+ The default format is: ` %%latitude %%longitude ` .
3838
3939# Output examples
4040
4141``` sh
4242./CoreLocationCLI
4343```
4444
45+ > ```
4546> 50.943829 6.941043
47+ > ```
4648
4749```sh
48- ./CoreLocationCLI -once yes - format " %latitude %longitude\n%address"
50+ ./CoreLocationCLI -format "%latitude %longitude\n%address"
4951```
5052
51- 50.943829 6.941043
52- Kaiser-Wilhelm-Ring 21
53- Cologne North Rhine-Westphalia 50672
54- Germany
53+ > ```
54+ > 50.943829 6.941043
55+ > Kaiser-Wilhelm-Ring 21
56+ > Cologne North Rhine-Westphalia 50672
57+ > Germany
58+ > ```
5559
5660```sh
5761./CoreLocationCLI -json
5862```
5963
60- ``` json
61- {"latitude" :40.124159 , "longitude" :-75.036274 }
62- ```
64+ > ``` json
65+ >{
66+ > "latitude": 40.141196
67+ > "longitude": -75.034815
68+ > "altitude": 92.00
69+ > "direction": -1.0
70+ > "speed": -1
71+ > "h_accuracy": 65
72+ > "v_accuracy": 10
73+ > "time": "2017-06-25 05:29:38 +0000"
74+ > "address": "407 Keats Rd
75+ >Lower Moreland PA 19006
76+ >United States"
77+ >}
78+ >```
6379
6480# Installation
6581
0 commit comments