mirror of
https://github.com/shakemid/pcsensor-temper.git
synced 2025-01-21 09:08:17 +01:00
Revert -c option
This commit is contained in:
parent
fcff31db7b
commit
0ca8fdb1a3
1 changed files with 10 additions and 6 deletions
16
pcsensor.c
16
pcsensor.c
|
@ -246,12 +246,15 @@ int main( int argc, char **argv) {
|
||||||
struct tm *local;
|
struct tm *local;
|
||||||
time_t t;
|
time_t t;
|
||||||
|
|
||||||
while ((c = getopt (argc, argv, "fvhl::")) != -1)
|
while ((c = getopt (argc, argv, "vcfl::h")) != -1)
|
||||||
switch (c)
|
switch (c)
|
||||||
{
|
{
|
||||||
case 'v':
|
case 'v':
|
||||||
debug = 1;
|
debug = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'c':
|
||||||
|
formato=1; //Celsius
|
||||||
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
formato=2; //Fahrenheit
|
formato=2; //Fahrenheit
|
||||||
break;
|
break;
|
||||||
|
@ -276,7 +279,8 @@ int main( int argc, char **argv) {
|
||||||
printf(" -h help\n");
|
printf(" -h help\n");
|
||||||
printf(" -v verbose\n");
|
printf(" -v verbose\n");
|
||||||
printf(" -l[n] loop every 'n' seconds, default value is 5s\n");
|
printf(" -l[n] loop every 'n' seconds, default value is 5s\n");
|
||||||
printf(" -f output in Fahrenheit (default: Celsius)\n");
|
printf(" -c output in Celsius (default)\n");
|
||||||
|
printf(" -f output in Fahrenheit\n");
|
||||||
|
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
default:
|
default:
|
||||||
|
@ -339,11 +343,11 @@ int main( int argc, char **argv) {
|
||||||
local->tm_sec);
|
local->tm_sec);
|
||||||
|
|
||||||
if (formato==2) {
|
if (formato==2) {
|
||||||
printf("%s\t%d\tinternal\t%.2f\n", strdate, i, (9.0 / 5.0 * tempInC + 32.0));
|
printf("%s\t%d\tinternal\t%.2f F\n", strdate, i, (9.0 / 5.0 * tempInC + 32.0));
|
||||||
printf("%s\t%d\texternal\t%.2f\n", strdate, i, (9.0 / 5.0 * tempExC + 32.0));
|
printf("%s\t%d\texternal\t%.2f F\n", strdate, i, (9.0 / 5.0 * tempExC + 32.0));
|
||||||
} else {
|
} else {
|
||||||
printf("%s\t%d\tinternal\t%.2f\n", strdate, i, tempInC);
|
printf("%s\t%d\tinternal\t%.2f C\n", strdate, i, tempInC);
|
||||||
printf("%s\t%d\texternal\t%.2f\n", strdate, i, tempExC);
|
printf("%s\t%d\texternal\t%.2f C\n", strdate, i, tempExC);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bsalir)
|
if (!bsalir)
|
||||||
|
|
Loading…
Add table
Reference in a new issue