Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions brightnessctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct device;
enum operation;

static void fail(char *, ...);
static void usage(void);
static void usage(FILE *);
static float parse_exponent(const char *);
#define cat_with(...) _cat_with(__VA_ARGS__, NULL)
static char *_cat_with(char, ...);
Expand Down Expand Up @@ -177,7 +177,7 @@ int main(int argc, char **argv) {
p.exponent = 4;
break;
case 'h':
usage();
usage(stdout);
exit(EXIT_SUCCESS);
case 'c':
p.class = strdup(optarg);
Expand All @@ -194,7 +194,7 @@ int main(int argc, char **argv) {
}
}
if (phelp) {
usage();
usage(stderr);
exit(EXIT_FAILURE);
}
argc -= optind;
Expand Down Expand Up @@ -711,9 +711,9 @@ void fail(char *err_msg, ...) {
exit(EXIT_FAILURE);
}

void usage() {
fprintf(stderr, "brightnessctl %s - read and control device brightness.\n\n", VERSION);
fprintf(stderr,
void usage(FILE *stream) {
fprintf(stream, "brightnessctl %s - read and control device brightness.\n\n", VERSION);
fprintf(stream,
"Usage: brightnessctl [options] [operation] [value]\n\
\n\
Options:\n\
Expand Down