Return 99 if an unknown flag occured. Also updated price_to_wattspersecond to price_kwh_to_wattspersecond.
This commit is contained in:
parent
cd84aee61f
commit
18a593e800
@ -33,10 +33,12 @@ int parse_arguments(const int argc, const char *const *const argv,
|
|||||||
return 1;
|
return 1;
|
||||||
else if (argv[i][1] == 'v' || argv[i][2] == 'v')
|
else if (argv[i][1] == 'v' || argv[i][2] == 'v')
|
||||||
return 2;
|
return 2;
|
||||||
|
else
|
||||||
|
return 99;
|
||||||
} else if (argc < 4) {
|
} else if (argc < 4) {
|
||||||
return 1;
|
return 1;
|
||||||
} else if (pos == 0) {
|
} else if (pos == 0) {
|
||||||
*price = price_to_wattspersecond((price_t)atof(argv[i]));
|
*price = price_kwh_to_wattspersecond((price_t)atof(argv[i]));
|
||||||
++pos;
|
++pos;
|
||||||
} else if (pos == 1) {
|
} else if (pos == 1) {
|
||||||
*wattage = (wattage_t)atof(argv[2]);
|
*wattage = (wattage_t)atof(argv[2]);
|
||||||
|
Loading…
Reference in New Issue
Block a user