victor / whereami

get your location from the command line
http://victor.github.io/whereami/
MIT License
213 stars 24 forks source link

Set own timeout and number of retry #11

Open ladislas opened 9 years ago

ladislas commented 9 years ago

Would be great to be able to set the timeout to be something else than 15 seconds and also to be able to retry a specific number of times.

Is it something you are thinking about? If not, I'll try to work on that and submit a PR :)

victor commented 9 years ago

Yes, the timeout option was in the plans. I'm not sure how the retry option would work, if you have denied permissions it can't ask again for them, so the only other thing that makes sense is waiting for the WiFi status to change. What I had considered, as early as when the implementation was in ObjC, is a continuous flag. So that it keeps showing the Core Location responses (or only the significant changes) until you hit ^C. Would you find that useful?

ladislas commented 9 years ago

Great news for the timeout :)

For the retry, regarding your other answer (https://github.com/victor/whereami/issues/10#issuecomment-68360674), I now understand why it doesn't really make sense.

A continuous output could be also interesting, on change or every X seconds.

If I understand correctly, for the moment it runs once and then exits and start all over if called a second time?

CoreLocationCLI has a --once option. But it doesn't work really well...

victor commented 9 years ago

I did not know about that utility. It looks like it indeed was thought to be used from the command line, while I see mine also being used in scripts, so the default mode of operation for each is opposite. I consider the continuous option a special case.

ladislas commented 9 years ago

I agree with you, the continuous option must be a special case. I'm currently using whereami to geotag my commits and display them on a map :)

It's great it's now available on brew it will be a lot easier to install. Taps are good but it's always one more step for the users.