Replaced printf in print_version() and print_usage() with puts.

This commit is contained in:
Alexander Andreev 2021-12-24 01:45:13 +04:00
parent eeafa1c269
commit 5ab493e7cc
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -75,13 +75,13 @@ inline price_t to_wattpersecond(price_t price) {
} }
void print_version() { void print_version() {
printf("kwh-calc Ver. " VERSION "\n" puts("kwh-calc Ver. " VERSION "\n"
"Copyright (C) 2021 Alexander \"Arav\" Andreev <me@arav.top>. All rights reserved.\n" "Copyright (C) 2021 Alexander \"Arav\" Andreev <me@arav.top>. All rights reserved.\n"
"License for this program is stored in /usr/share/licenses/kwh-calc/LICENSE."); "License for this program is stored in /usr/share/licenses/kwh-calc/LICENSE.");
} }
void print_usage() { void print_usage() {
printf("Usage: kwh-calc [options] price wattage interval [interval ...]\n" puts("Usage: kwh-calc [options] price wattage interval [interval ...]\n"
"Options:\n" "Options:\n"
" --help, -h Display this usage information.\n" " --help, -h Display this usage information.\n"
" --version, -v Display program version.\n" " --version, -v Display program version.\n"
@ -91,5 +91,5 @@ void print_usage() {
" interval Time interval in seconds total cost to be calculated for.\n" " interval Time interval in seconds total cost to be calculated for.\n"
" You may specify other time units such as:\n" " You may specify other time units such as:\n"
" m'imute, h'our, d'ay. Example: 5d 3h.\n" " m'imute, h'our, d'ay. Example: 5d 3h.\n"
" All given intervals will be summed up.\n"); " All given intervals will be summed up.");
} }