From ad4d5be6ab66fdb977542016bb1de499351550d3 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 4 Feb 2013 13:51:20 -0800 Subject: [PATCH] Give preference with HELP dev SHOW and HELP dev SET for unit modifiers to be displayed with a unit number as an example (unless the device has only one unit). --- scp.c | 4 ++++ scp.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/scp.c b/scp.c index cee9e3c3..20aa262f 100644 --- a/scp.c +++ b/scp.c @@ -1105,6 +1105,8 @@ if (dptr->modifiers) { for (mptr = dptr->modifiers; mptr->mask != 0; mptr++) { if (!MODMASK(mptr,MTAB_VDV) && MODMASK(mptr,MTAB_VUN)) continue; /* skip unit only modifiers */ + if ((dptr->numunits != 1) && !(mptr->mask & MTAB_XTD)) + continue; if (mptr->mstring) { sprintf (buf, "set %s %s%s", sim_dname (dptr), mptr->mstring, (strchr(mptr->mstring, '=')) ? "" : (MODMASK(mptr,MTAB_VALR) ? "=val" : (MODMASK(mptr,MTAB_VALO) ? "{=val}" : ""))); fprintf (st, "%-30s\t%s\n", buf, (strchr(mptr->mstring, '=')) ? "" : (mptr->help ? mptr->help : "")); @@ -1161,6 +1163,8 @@ if (dptr->modifiers) { continue; /* skip unit only modifiers */ if ((!mptr->disp) || (!mptr->pstring) || !(*mptr->pstring)) continue; + if ((dptr->numunits != 1) && !(mptr->mask & MTAB_XTD)) + continue; sprintf (buf, "show %s %s%s", sim_dname (dptr), mptr->pstring, MODMASK(mptr,MTAB_SHP) ? "=arg" : ""); fprintf (st, "%-30s\t%s\n", buf, mptr->help ? mptr->help : ""); } diff --git a/scp.h b/scp.h index 47454a0b..61dfe956 100644 --- a/scp.h +++ b/scp.h @@ -114,6 +114,9 @@ char *get_range (DEVICE *dptr, char *cptr, t_addr *lo, t_addr *hi, uint32 rdx, t_addr max, char term); t_value strtotv (const char *cptr, char **endptr, uint32 radix); t_stat fprint_val (FILE *stream, t_value val, uint32 rdx, uint32 wid, uint32 fmt); +void fprint_reg_help (FILE *st, DEVICE *dptr); +void fprint_set_help (FILE *st, DEVICE *dptr); +void fprint_show_help (FILE *st, DEVICE *dptr); CTAB *find_cmd (char *gbuf); DEVICE *find_dev (char *ptr); DEVICE *find_unit (char *ptr, UNIT **uptr);