18. Get

Gets a page and prints it to standard output.

<<argparse_entries>>=
{"get", 3, p_get, NULL},
<<static_funcdefs>>=
static int p_get(int argc, char *argv[]);
<<functions>>=
static int p_get(int argc, char *argv[])
{
    weewiki_d ww;
    int rc;

    if (argc < 2) {
        fprintf(stderr, "Usage: %s page\n", argv[0]);
        return 1;
    }

    weewiki_init(&ww);
    weewiki_open(&ww, weewiki_dbname_get());

    rc = weewiki_getter(&ww, argv[1]);

    weewiki_close(&ww);
    weewiki_clean(&ww);

    return rc;
}



prev | home | next