Skip to content

Commit

Permalink
conf: Improve bitlbee -V output
Browse files Browse the repository at this point in the history
  • Loading branch information
dequis committed Jun 22, 2022
1 parent cc0ad0a commit 2e5f594
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ conf_t *conf_load(int argc, char *argv[])
{
conf_t *conf;
int opt, i, config_missing = 0;
int version_happened = 0;

conf = g_new0(conf_t, 1);

Expand Down Expand Up @@ -141,16 +142,22 @@ conf_t *conf_load(int argc, char *argv[])
conf_free(conf);
return NULL;
} else if (opt == 'V') {
printf("BitlBee %s\nAPI version %06x\nConfigure args: %s\n",
BITLBEE_VERSION, BITLBEE_VERSION_CODE, BITLBEE_CONFIGURE_ARGS);
conf_free(conf);
return NULL;
printf("BitlBee %s\n", BITLBEE_VERSION);
/* the rest of the version string is displayed below, for ld -vvv compatibility*/
version_happened = TRUE;
} else if (opt == 'u') {
g_free(conf->user);
conf->user = g_strdup(optarg);
}
}

if (version_happened) {
printf("API version %06x\nConfigure args: %s\n",
BITLBEE_VERSION_CODE, BITLBEE_CONFIGURE_ARGS);
conf_free(conf);
return NULL;
}

if (conf->configdir[strlen(conf->configdir) - 1] != '/') {
char *s = g_new(char, strlen(conf->configdir) + 2);

Expand Down

0 comments on commit 2e5f594

Please sign in to comment.