+ }
+ conf->includes = mandoc_strdup(cp);
+ return 0;
+ case 1:
+ if (conf->man != NULL) {
+ oldval = mandoc_strdup(conf->man);
+ break;
+ }
+ conf->man = mandoc_strdup(cp);
+ return 0;
+ case 2:
+ if (conf->paper != NULL) {
+ oldval = mandoc_strdup(conf->paper);
+ break;
+ }
+ conf->paper = mandoc_strdup(cp);
+ return 0;
+ case 3:
+ if (conf->style != NULL) {
+ oldval = mandoc_strdup(conf->style);
+ break;
+ }
+ conf->style = mandoc_strdup(cp);
+ return 0;
+ case 4:
+ if (conf->indent) {
+ mandoc_asprintf(&oldval, "%zu", conf->indent);
+ break;
+ }
+ conf->indent = strtonum(cp, 0, 1000, &errstr);
+ if (errstr == NULL)
+ return 0;
+ mandoc_msg(MANDOCERR_BADVAL_BAD, 0, 0,
+ "-O indent=%s is %s", cp, errstr);
+ return -1;
+ case 5:
+ if (conf->width) {
+ mandoc_asprintf(&oldval, "%zu", conf->width);
+ break;
+ }
+ conf->width = strtonum(cp, 1, 1000, &errstr);
+ if (errstr == NULL)
+ return 0;
+ mandoc_msg(MANDOCERR_BADVAL_BAD, 0, 0,
+ "-O width=%s is %s", cp, errstr);
+ return -1;
+ case 6:
+ if (conf->tag != NULL) {
+ oldval = mandoc_strdup(conf->tag);
+ break;
+ }
+ conf->tag = mandoc_strdup(cp);
+ return 0;
+ case 7:
+ conf->fragment = 1;
+ return 0;
+ case 8:
+ conf->mdoc = 1;
+ return 0;
+ case 9:
+ conf->noval = 1;
+ return 0;
+ case 10:
+ conf->toc = 1;
+ return 0;
+ default:
+ mandoc_msg(MANDOCERR_BADARG_BAD, 0, 0, "-O %s", cp);
+ return -1;
+ }
+ if (fromfile) {
+ free(oldval);
+ return 0;
+ } else {
+ mandoc_msg(MANDOCERR_BADVAL_DUPE, 0, 0,
+ "-O %s=%s: already set to %s", toks[tok], cp, oldval);
+ free(oldval);
+ return -1;