19. Set

Gets a page and prints it to standard output.

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

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

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

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

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

    return rc;
}



prev | home | next