<commit_before>#include "shared/log.h"

#include "pngtile.h"

#include <getopt.h>
#include <stdio.h>
#include <stdbool.h>

/**
 * Command-line options
 */
static const struct option options[] = {
    { "help",           false,  NULL,   'h' },
    { "quiet",          false,  NULL,   'q' },
    { "verbose",        false,  NULL,   'v' },
    { "debug",          false,  NULL,   'D' },
    { "force-update",   false,  NULL,   'U' },
    { "no-update",      false,  NULL,   'N' },
    { "background",     true,   NULL,   'B' },
    { "width",          true,   NULL,   'W' },
    { "height",         true,   NULL,   'H' },
    { "x",              true,   NULL,   'x' },
    { "y",              true,   NULL,   'y' },
    { "zoom",           true,   NULL,   'z' },
    { "threads",        true,   NULL,   'j' },
    { 0,                0,      0,      0   }
};

/**
 * Print usage/help info on stderr
 */
void help (const char *argv0)
{
    fprintf(stderr, "Usage: %s [options] <image> [...]\n", argv0);
    fprintf(stderr,
        "Open each of the given image files, check cache status, optionally update their cache, display image info, and\n"
        "optionally render a tile of each.\n"
        "\n"
        "\t-h, --help           show this help and exit\n"
        "\t-q, --quiet          supress informational output\n"
        "\t-v, --verbose        display more informational output\n"
        "\t-D, --debug          equivalent to -v\n"
        "\t-U, --force-update   unconditionally update image caches\n"
        "\t-N, --no-update      do not update the image cache\n"
        "\t-B, --background     set background pattern for sparse cache file: 0xHH..\n"
        "\t-W, --width          set tile width\n"
        "\t-H, --height         set tile height\n"
        "\t-x, --x              set tile x offset\n"
        "\t-y, --y              set tile z offset\n"
        "\t-z, --zoom           set zoom factor (<0)\n"
        "\t-j, --threads        number of threads\n"
    );
}

int main (int argc, char **argv)
{
    int opt;
    bool force_update = false, no_update = false;
    struct pt_tile_info ti = {0, 0, 0, 0, 0};
    struct pt_image_params update_params = { };
    int threads = 2;
    int tmp, err;
    
    // parse arguments
    while ((opt = getopt_long(argc, argv, "hqvDUNB:W:H:x:y:z:j:", options, NULL)) != -1) {
        switch (opt) {
            case 'h':<commit_msg>fix --help --y typo<commit_after>#include "shared/log.h"

#include "pngtile.h"

#include <getopt.h>
#include <stdio.h>
#include <stdbool.h>

/**
 * Command-line options
 */
static const struct option options[] = {
    { "help",           false,  NULL,   'h' },
    { "quiet",          false,  NULL,   'q' },
    { "verbose",        false,  NULL,   'v' },
    { "debug",          false,  NULL,   'D' },
    { "force-update",   false,  NULL,   'U' },
    { "no-update",      false,  NULL,   'N' },
    { "background",     true,   NULL,   'B' },
    { "width",          true,   NULL,   'W' },
    { "height",         true,   NULL,   'H' },
    { "x",              true,   NULL,   'x' },
    { "y",              true,   NULL,   'y' },
    { "zoom",           true,   NULL,   'z' },
    { "threads",        true,   NULL,   'j' },
    { 0,                0,      0,      0   }
};

/**
 * Print usage/help info on stderr
 */
void help (const char *argv0)
{
    fprintf(stderr, "Usage: %s [options] <image> [...]\n", argv0);
    fprintf(stderr,
        "Open each of the given image files, check cache status, optionally update their cache, display image info, and\n"
        "optionally render a tile of each.\n"
        "\n"
        "\t-h, --help           show this help and exit\n"
        "\t-q, --quiet          supress informational output\n"
        "\t-v, --verbose        display more informational output\n"
        "\t-D, --debug          equivalent to -v\n"
        "\t-U, --force-update   unconditionally update image caches\n"
        "\t-N, --no-update      do not update the image cache\n"
        "\t-B, --background     set background pattern for sparse cache file: 0xHH..\n"
        "\t-W, --width          set tile width\n"
        "\t-H, --height         set tile height\n"
        "\t-x, --x              set tile x offset\n"
        "\t-y, --y              set tile y offset\n"
        "\t-z, --zoom           set zoom factor (<0)\n"
        "\t-j, --threads        number of threads\n"
    );
}

int main (int argc, char **argv)
{
    int opt;
    bool force_update = false, no_update = false;
    struct pt_tile_info ti = {0, 0, 0, 0, 0};
    struct pt_image_params update_params = { };
    int threads = 2;
    int tmp, err;
    
    // parse arguments
    while ((opt = getopt_long(argc, argv, "hqvDUNB:W:H:x:y:z:j:", options, NULL)) != -1) {
        switch (opt) {
            case 'h':
{'fraction_non_alphanumeric': 0.1651414309484193, 'fraction_numerical': 0.006239600665557404, 'mean_word_length': 1.5634328358208955, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2926766', 'n_tokens_mistral': 1655, 'n_tokens_neox': 1630, 'n_words': 482}