Skip to content

Commit 93ef2ca

Browse files
committed
Add documentation to note can install Homebrew
1 parent 8974ba2 commit 93ef2ca

File tree

1 file changed

+56
-43
lines changed

1 file changed

+56
-43
lines changed

README.md

Lines changed: 56 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,82 @@
1-
# Usage
1+
# CoreLocationCLI
22

3-
`./CoreLocationCLI [-once]`
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.*
44

5-
If running from a Mac, make sure your WiFi is turned on. Otherwise you will see `kCLErrorDomain error 0`.
5+
![Usage](https://cloud.githubusercontent.com/assets/382183/25063655/52c11234-221d-11e7-81fb-0f8712dac393.gif)
66

7-
# Overview
7+
Note for Mac users: make sure WiFi is turned on. Otherwise you will see `kCLErrorDomain error 0`.
88

9-
Prints location information from CoreLocation. If the `-once YES` option
10-
is used, will exit after first location update. Otherwise, will
11-
continuously print output. After you download, be sure to chmod 755
12-
and run from Terminal.
9+
# Usage
1310

14-
```
15-
USAGE: CoreLocationCLI [options]
16-
Displays current location using CoreLocation services.
17-
By default, this will continue printing locations until you kill it with Ctrl-C.
18-
19-
OPTIONS:
20-
-h Display this help message and exit
21-
22-
-once YES Print one location and exit
23-
-verbose YES Verbose mode
24-
-format 'format' Print a formatted string with the following specifiers
25-
%%latitude Latitude (degrees north; or negative for south
26-
%%longitude Longitude (degrees west; or negative for east
27-
%%altitude Altitude (meters)
28-
%%direction Degrees from true north
29-
%%speed Meters per second
30-
%%h_accuracy Horizontal accuracy (meters)
31-
%%v_accuracy Vertical accuracy (meters)
32-
%%time Time
33-
%%address Reverse geocoded location to an address
34-
-json Use the format {\"latitude\":%latitude, \"longitude\":%longitude}
35-
Also implies -once
36-
37-
Default format if unspecified is: %%latitude %%longitude
11+
```sh
12+
CoreLocationCLI -h
13+
CoreLocationCLI [-once] -json
14+
CoreLocationCLI [-once] [-verbose] [-format FORMAT]
3815
```
3916

40-
# Output example
41-
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 |
23+
| `-format FORMAT` | Print a formatted string with the following specifiers |
24+
25+
| Format | Description |
26+
| -------------- | ---------------------------------------------- |
27+
| `%%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 |
36+
37+
The default format if unspecified is: `%%latitude %%longitude`.
38+
39+
# Output examples
40+
41+
```sh
4242
./CoreLocationCLI
43+
```
4344

44-
50.943829 6.941043
45+
> 50.943829 6.941043
4546
47+
```sh
4648
./CoreLocationCLI -once yes -format "%latitude %longitude\n%address"
49+
```
4750

4851
50.943829 6.941043
4952
Kaiser-Wilhelm-Ring 21
5053
Cologne North Rhine-Westphalia 50672
5154
Germany
5255

56+
```sh
5357
./CoreLocationCLI -json
58+
```
5459

55-
{"latitude":40.124159, "longitude":-75.036274}
60+
```json
61+
{"latitude":40.124159, "longitude":-75.036274}
62+
```
5663

57-
# Building
64+
# Installation
5865

59-
To build this from the command line, run the compiler:
66+
Install the latest release using Homebrew with:
6067

61-
xcodebuild
68+
```sh
69+
brew cask install corelocationcli
70+
```
6271

63-
And then your executable can be run from this location:
72+
Or build from the command line using the Xcode compiler:
6473

65-
build/Release/CoreLocationCLI
74+
```sh
75+
xcodebuild
76+
```
6677

67-
# Contact
78+
Then run your executable from this location:
6879

69-
80+
```sh
81+
build/Release/CoreLocationCLI
82+
```

0 commit comments

Comments
 (0)