Repository: valkey-io/valkey
File: src/server.c (C)

Code before:
void daemonize(void) {
    int fd;

    if (valkey_fork() != 0) exit(0); /* parent exits */
    setsid();                        /* create a new session */

    /* Every output goes to /dev/null. If the server is daemonized but
     * the 'logfile' is set to 'stdout' in the configuration file
     * it will not log at all. */
    if ((fd = open("/dev/null", O_RDWR, 0)) != -1) {
        dup2(fd, STDIN_FILENO);
        dup2(fd, STDOUT_FILENO);
        dup2(fd, STDERR_FILENO);
        if (fd > STDERR_FILENO) close(fd);
    }
}

sds getVersion(void) {
    sds version = sdscatprintf(sdsempty(), "v=%s sha=%s:%d malloc=%s bits=%d build=%llx", VALKEY_VERSION,
                               serverGitSHA1(), atoi(serverGitDirty()) > 0, ZMALLOC_LIB, sizeof(long) == 4 ? 32 : 64,
                               (unsigned long long)serverBuildId());
    return version;
}

void usage(void) {
    fprintf(stderr, "Usage: ./valkey-server [/path/to/valkey.conf] [options] [-]\n");
    fprintf(stderr, "       ./valkey-server - (read config from stdin)\n");
    fprintf(stderr, "       ./valkey-server -v or --version\n");
    fprintf(stderr, "       ./valkey-server -h or --help\n");
    fprintf(stderr, "       ./valkey-server --test-memory <megabytes>\n");
    fprintf(stderr, "       ./valkey-server --check-system\n");
    fprintf(stderr, "\n");
    fprintf(stderr, "Examples:\n");
    fprintf(stderr, "       ./valkey-server (run the server with default conf)\n");
    fprintf(stderr, "       echo 'maxmemory 128mb' | ./valkey-server -\n");
    fprintf(stderr, "       ./valkey-server /etc/valkey/6379.conf\n");
    fprintf(stderr, "       ./valkey-server --port 7777\n");
    fprintf(stderr, "       ./valkey-server --port 7777 --replicaof 127.0.0.1 8888\n");
    fprintf(stderr, "       ./valkey-server /etc/myvalkey.conf --loglevel verbose -\n");
    fprintf(stderr, "       ./valkey-server /etc/myvalkey.conf --loglevel verbose\n\n");
    fprintf(stderr, "Sentinel mode:\n");
    fprintf(stderr, "       ./valkey-server /etc/sentinel.conf --sentinel\n");
    exit(1);
}

void serverAsciiArt(void) {
#include "asciilogo.h"
    char *buf = zmalloc(1024 * 16);
    char *mode;

    if (server.cluster_enabled)

Review comment (suggestion):
Simplification? If you want.

```suggestion
    printf("Usage: ./valkey-server [/path/to/valkey.conf] [options] [-]\n");
```

Code after:
void daemonize(void) {
    int fd;

    if (valkey_fork() != 0) exit(0); /* parent exits */
    setsid();                        /* create a new session */

    /* Every output goes to /dev/null. If the server is daemonized but
     * the 'logfile' is set to 'stdout' in the configuration file
     * it will not log at all. */
    if ((fd = open("/dev/null", O_RDWR, 0)) != -1) {
        dup2(fd, STDIN_FILENO);
        dup2(fd, STDOUT_FILENO);
        dup2(fd, STDERR_FILENO);
        if (fd > STDERR_FILENO) close(fd);
    }
}

sds getVersion(void) {
    sds version = sdscatprintf(sdsempty(), "v=%s sha=%s:%d malloc=%s bits=%d build=%llx", VALKEY_VERSION,
                               serverGitSHA1(), atoi(serverGitDirty()) > 0, ZMALLOC_LIB, sizeof(long) == 4 ? 32 : 64,
                               (unsigned long long)serverBuildId());
    return version;
}

void usage(void) {
    fprintf(stdout, "Usage: ./valkey-server [/path/to/valkey.conf] [options] [-]\n");
    fprintf(stdout, "       ./valkey-server - (read config from stdin)\n");
    fprintf(stdout, "       ./valkey-server -v or --version\n");
    fprintf(stdout, "       ./valkey-server -h or --help\n");
    fprintf(stdout, "       ./valkey-server --test-memory <megabytes>\n");
    fprintf(stdout, "       ./valkey-server --check-system\n");
    fprintf(stdout, "\n");
    fprintf(stdout, "Examples:\n");
    fprintf(stdout, "       ./valkey-server (run the server with default conf)\n");
    fprintf(stdout, "       echo 'maxmemory 128mb' | ./valkey-server -\n");
    fprintf(stdout, "       ./valkey-server /etc/valkey/6379.conf\n");
    fprintf(stdout, "       ./valkey-server --port 7777\n");
    fprintf(stdout, "       ./valkey-server --port 7777 --replicaof 127.0.0.1 8888\n");
    fprintf(stdout, "       ./valkey-server /etc/myvalkey.conf --loglevel verbose -\n");
    fprintf(stdout, "       ./valkey-server /etc/myvalkey.conf --loglevel verbose\n\n");
    fprintf(stdout, "Sentinel mode:\n");
    fprintf(stdout, "       ./valkey-server /etc/sentinel.conf --sentinel\n");
    exit(0);
}

void serverAsciiArt(void) {
#include "asciilogo.h"
    char *buf = zmalloc(1024 * 16);
    char *mode;

    if (server.cluster_enabled)