diff options
author | Jon Lund Steffensen <jonlst@gmail.com> | 2017-10-12 12:36:36 -0700 |
---|---|---|
committer | Jon Lund Steffensen <jonlst@gmail.com> | 2017-10-12 12:36:39 -0700 |
commit | 64600ae55ded957a22e9df5a8ccef151335aaf10 (patch) | |
tree | 215794363cd5da55a55cbe686c1dc4afaa88e9b1 /src/redshift.c | |
parent | Merge pull request #531 from jonls/time-adjustment-docs (diff) | |
download | redshift-ng-64600ae55ded957a22e9df5a8ccef151335aaf10.tar.gz redshift-ng-64600ae55ded957a22e9df5a8ccef151335aaf10.tar.bz2 redshift-ng-64600ae55ded957a22e9df5a8ccef151335aaf10.tar.xz |
Fix missing checks and verbose output
Rearrange checks and verbose output in main() to bring back checks
that were accidentally left out when time-based adjustments were
enabled. This includes the output indicating the daytime/night
temperatures and the check that the temperatures are valid.
Diffstat (limited to 'src/redshift.c')
-rw-r--r-- | src/redshift.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/redshift.c b/src/redshift.c index efe21bd..4774b7e 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -1760,15 +1760,28 @@ main(int argc, char *argv[]) } } - if (verbose) { - printf(_("Temperatures: %dK at day, %dK at night\n"), - scheme.day.temperature, - scheme.night.temperature); + /* Solar elevations */ + if (scheme.high < scheme.low) { + fprintf(stderr, + _("High transition elevation cannot be lower than" + " the low transition elevation.\n")); + exit(EXIT_FAILURE); + } + if (verbose) { /* TRANSLATORS: Append degree symbols if possible. */ printf(_("Solar elevations: day above %.1f, night below %.1f\n"), scheme.high, scheme.low); } + } + + if (mode != PROGRAM_MODE_RESET && + mode != PROGRAM_MODE_MANUAL) { + if (verbose) { + printf(_("Temperatures: %dK at day, %dK at night\n"), + scheme.day.temperature, + scheme.night.temperature); + } /* Color temperature */ if (scheme.day.temperature < MIN_TEMP || @@ -1780,14 +1793,6 @@ main(int argc, char *argv[]) MIN_TEMP, MAX_TEMP); exit(EXIT_FAILURE); } - - /* Solar elevations */ - if (scheme.high < scheme.low) { - fprintf(stderr, - _("High transition elevation cannot be lower than" - " the low transition elevation.\n")); - exit(EXIT_FAILURE); - } } if (mode == PROGRAM_MODE_MANUAL) { |