fulldecent / corelocationcli

Command line program to print location information from CoreLocation
MIT License
218 stars 29 forks source link

version 2.0.0 seems to ignore format string #13

Closed sneak closed 8 years ago

sneak commented 8 years ago
sneak@pris:~$ CoreLocationCLI -once YES -format '{ "lat": %latitude, "lon": %longitude }'
<+37.REDACTED,-80.REDACTED> +/- 134.13m (speed -1.00 mps / course -1.00) @ 10/8/16, 00:05:58 Eastern Daylight Time
sneak commented 8 years ago

sneak@pris:~$ CoreLocationCLI -once yes -format '%latitude : %longitude'
works
sneak@pris:~$ CoreLocationCLI -once yes -format 'x %latitude : %longitude'
works
sneak@pris:~$ CoreLocationCLI -once yes -format '"lat" %latitude : %longitude'
fails
sneak@pris:~$ CoreLocationCLI -once yes -format 'lat %latitude : %longitude'
works
sneak@pris:~$ CoreLocationCLI -once yes -format '{ lat %latitude : %longitude'
fails
sneak commented 8 years ago

really would defaulting to json output be so bad?

fulldecent commented 8 years ago

Hmmm interesting that the other ones work but that one fails.

I would love JSON output everywhere. But convention seems to be that command line tools do not output JSON. Maybe we can make a -json option, but it would have to be streaming json.

sneak commented 8 years ago

Convention is wrong now that jq -r exists. Also, I always use -once.

fulldecent commented 8 years ago

That makes sense, -json can imply -once. I'm not sure how jq -r works.

derhuerst commented 8 years ago

I'm not sure how jq -r works.

@fulldecent See the manual for jq.

@sneak I don't think jq can be considered a standard/convention by now. It is still far too unknown.

derhuerst commented 8 years ago

Why doesn't CoreLocationCLI output all information via JSON (like accuracy, speed, direction)? Right now, -json is a showstopper for me because it doesn't give me accuracy?

derhuerst commented 8 years ago

Why doesn't CoreLocationCLI output all information via JSON (like accuracy, speed, direction)? Right now, -json is a showstopper for me because it doesn't give me accuracy.

bump.

derhuerst commented 8 years ago

Also, it seems like you made backwards-incompatible changes with v2.2.0 😢