From 0bc77c4d90e9b8307341ee3556fea5701bafbf9d Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 10 Sep 2021 11:38:37 -0700 Subject: [PATCH] PDP11, VAX: Add or correct help output for some SET commands As discussed in #1077 --- PDP11/pdp11_dz.c | 2 +- scp.c | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/PDP11/pdp11_dz.c b/PDP11/pdp11_dz.c index 962dd909..22b05fd6 100644 --- a/PDP11/pdp11_dz.c +++ b/PDP11/pdp11_dz.c @@ -347,7 +347,7 @@ MTAB dz_mod[] = { { MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, "LINES", "LINES=n", &dz_setnl, &tmxr_show_lines, (void *) &dz_desc, "Display number of lines" }, { MTAB_XTD|MTAB_VDV|MTAB_NC, 0, NULL, "LOG=n=file", - &dz_set_log, NULL, &dz_desc }, + &dz_set_log, NULL, &dz_desc, "Enables logging on designated line" }, { MTAB_XTD|MTAB_VDV|MTAB_VALR, 0, NULL, "NOLOG=n", &dz_set_nolog, NULL, &dz_desc, "Disable logging on designated line" }, { MTAB_XTD|MTAB_VDV|MTAB_NMO, 0, "LOG", NULL, diff --git a/scp.c b/scp.c index 98f983fe..6ec9f755 100644 --- a/scp.c +++ b/scp.c @@ -3404,7 +3404,24 @@ if (dptr->modifiers) { if (mptr->mstring) { fprint_header (st, &found, header); snprintf (buf, sizeof (buf), "set %s %s%s", sim_dname (dptr), mptr->mstring, (strchr(mptr->mstring, '=')) ? "" : (MODMASK(mptr,MTAB_VALR) ? "=val" : (MODMASK(mptr,MTAB_VALO) ? "{=val}" : ""))); - fprint_wrapped (st, buf, 30, gap, mptr->help, 80); + if ((mptr->valid != NULL) && (mptr->disp != NULL) && (mptr->help != NULL)) { + char gbuf[CBUFSIZE]; + const char *rem; + + rem = get_glyph (mptr->help, gbuf, 0); + if ((strcasecmp (gbuf, "Display") == 0) || + (strcasecmp (gbuf, "Show") == 0)) { + char *thelp = (char *)malloc (9 + strlen (rem)); + + sprintf (thelp, "Specify %s", rem); + fprint_wrapped (st, buf, 30, gap, thelp, 80); + free (thelp); + } + else + fprint_wrapped (st, buf, 30, gap, mptr->help, 80); + } + else + fprint_wrapped (st, buf, 30, gap, mptr->help, 80); } } } @@ -3487,7 +3504,24 @@ if ((dptr->modifiers) && (dptr->units)) { /* handle unit specific modifiers */ if (mptr->mstring) { fprint_header (st, &found, header); snprintf (buf, sizeof (buf), "set %s %s%s", unit_spec, mptr->mstring, (strchr(mptr->mstring, '=')) ? "" : (MODMASK(mptr,MTAB_VALR) ? "=val" : (MODMASK(mptr,MTAB_VALO) ? "{=val}": ""))); - fprint_wrapped (st, buf, 30, gap, mptr->help, 80); + if ((mptr->valid != NULL) && (mptr->disp != NULL) && (mptr->help != NULL)) { + char gbuf[CBUFSIZE]; + const char *rem; + + rem = get_glyph (mptr->help, gbuf, 0); + if ((strcasecmp (gbuf, "Display") == 0) || + (strcasecmp (gbuf, "Show") == 0)) { + char *thelp = (char *)malloc (9 + strlen (rem)); + + sprintf (thelp, "Specify %s", rem); + fprint_wrapped (st, buf, 30, gap, thelp, 80); + free (thelp); + } + else + fprint_wrapped (st, buf, 30, gap, mptr->help, 80); + } + else + fprint_wrapped (st, buf, 30, gap, mptr->help, 80); } } }