Changeset 2e5f594


Ignore:
Timestamp:
2022-06-22T11:52:03Z (22 months ago)
Author:
dequis <dx@…>
Branches:
master
Children:
b82ba4a
Parents:
cc0ad0a
Message:

conf: Improve bitlbee -V output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • conf.c

    rcc0ad0a r2e5f594  
    4343        conf_t *conf;
    4444        int opt, i, config_missing = 0;
     45        int version_happened = 0;
    4546
    4647        conf = g_new0(conf_t, 1);
     
    142143                        return NULL;
    143144                } else if (opt == 'V') {
    144                         printf("BitlBee %s\nAPI version %06x\nConfigure args: %s\n",
    145                                BITLBEE_VERSION, BITLBEE_VERSION_CODE, BITLBEE_CONFIGURE_ARGS);
    146                         conf_free(conf);
    147                         return NULL;
     145                        printf("BitlBee %s\n", BITLBEE_VERSION);
     146                        /* the rest of the version string is displayed below, for ld -vvv compatibility*/
     147                        version_happened = TRUE;
    148148                } else if (opt == 'u') {
    149149                        g_free(conf->user);
    150150                        conf->user = g_strdup(optarg);
    151151                }
     152        }
     153
     154        if (version_happened) {
     155                printf("API version %06x\nConfigure args: %s\n",
     156                       BITLBEE_VERSION_CODE, BITLBEE_CONFIGURE_ARGS);
     157                conf_free(conf);
     158                return NULL;
    152159        }
    153160
Note: See TracChangeset for help on using the changeset viewer.