Option cleanup

master 0.1.0
Kenny Levinsen 2020-10-21 01:41:49 +02:00
parent 0da97df89e
commit 0569fb45bd
1 changed files with 4 additions and 6 deletions

10
main.c
View File

@ -684,12 +684,10 @@ static int wlrun(struct config cfg) {
static const char usage[] = "usage: %s [options]\n" static const char usage[] = "usage: %s [options]\n"
" -h show this help message\n" " -h show this help message\n"
" -T <temp> set high temperature (default: 6500)\n"
" -t <temp> set low temperature (default: 4000)\n" " -t <temp> set low temperature (default: 4000)\n"
" -T <temp> set high temperature (default: 6500)\n"
" -l <lat> set latitude (e.g. 39.9)\n" " -l <lat> set latitude (e.g. 39.9)\n"
" -L <long> set longitude (e.g. 116.3)\n" " -L <long> set longitude (e.g. 116.3)\n"
" -s <start> set manual start time (e.g. 06:30)\n"
" -S <stop> set manual stop time (e.g. 19:30)\n"
" -g <gamma> set gamma (default: 1.0)\n"; " -g <gamma> set gamma (default: 1.0)\n";
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
@ -708,12 +706,12 @@ int main(int argc, char *argv[]) {
int opt; int opt;
while ((opt = getopt(argc, argv, "ht:T:l:L:d:g:")) != -1) { while ((opt = getopt(argc, argv, "ht:T:l:L:d:g:")) != -1) {
switch (opt) { switch (opt) {
case 'T':
config.high_temp = strtol(optarg, NULL, 10);
break;
case 't': case 't':
config.low_temp = strtol(optarg, NULL, 10); config.low_temp = strtol(optarg, NULL, 10);
break; break;
case 'T':
config.high_temp = strtol(optarg, NULL, 10);
break;
case 'l': case 'l':
config.latitude = strtod(optarg, NULL); config.latitude = strtod(optarg, NULL);
break; break;