Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to only print integers #20

Open
jasonwryan opened this issue Jul 26, 2014 · 2 comments
Open

Option to only print integers #20

jasonwryan opened this issue Jul 26, 2014 · 2 comments

Comments

@jasonwryan
Copy link

A nice feature, when using shaman to print to a status bar, would be to just print the integer, e.g., rather than 10.75°C just print 10°C.

This would make most sense as a switch passed to all numeric values for the return of any given command, for example:

shaman -l Wellington,NZ -m -f -d "%t°C"
10°C

shaman -l Wellington,NZ -m -f  -d "Currently %t°C. %c with %wkm/h winds from %X."
Currently 10°C with 8km/h winds from SE

as opposed to:

Currently 10.75°C with 8.65km/h winds from SE
@HalosGhost
Copy link
Owner

All right, I will look into this. We are getting dangerously close to the point where using function parameters for these options is going to be silly (read: way too many function parameters). As a result, I may have to look into adopting a curl_easy_setopt() style.

That is, rather than calling owm_easy() with an overwhelming number of arguments, developers (and shaman) would call something like owm_easy_init() which creates a struct with various options (that can be modified with owm_easy_setopt()), and then you would pass the struct to owm_easy().

This is actually a great idea (since it means adding more options is much more sustainable), but it will require a fair bit of restructuring; and, what you actually want with this feature request (an option to print all numeric values as integers) won't really be doable without such a restructuring.

Consider it on the to-do list. Requires #21 for implementation.

@jasonwryan
Copy link
Author

Thanks HG: much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants