SCP: Give priority to device names in intial HELP commands
This commit is contained in:
parent
8d172a4049
commit
590be6b0dd
1 changed files with 98 additions and 94 deletions
36
scp.c
36
scp.c
|
@ -2825,6 +2825,11 @@ for (cmdp = cmd_table; cmdp && (cmdp->name != NULL); cmdp++) {
|
||||||
max_cmdname_size = strlen(cmdp->name);
|
max_cmdname_size = strlen(cmdp->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fprintf (st, "Help is available for devices\n\n");
|
||||||
|
fprintf (st, " HELP dev\n");
|
||||||
|
fprintf (st, " HELP dev SET\n");
|
||||||
|
fprintf (st, " HELP dev SHOW\n");
|
||||||
|
fprintf (st, " HELP dev REGISTERS\n\n");
|
||||||
fprintf (st, "Help is available for the following commands:\n\n ");
|
fprintf (st, "Help is available for the following commands:\n\n ");
|
||||||
qsort (hlp_cmdp, cmd_cnt, sizeof(*hlp_cmdp), _cmd_name_compare);
|
qsort (hlp_cmdp, cmd_cnt, sizeof(*hlp_cmdp), _cmd_name_compare);
|
||||||
line_offset = 4;
|
line_offset = 4;
|
||||||
|
@ -3224,12 +3229,26 @@ t_stat help_cmd (int32 flag, CONST char *cptr)
|
||||||
{
|
{
|
||||||
char gbuf[CBUFSIZE], gbuf2[CBUFSIZE];
|
char gbuf[CBUFSIZE], gbuf2[CBUFSIZE];
|
||||||
CTAB *cmdp;
|
CTAB *cmdp;
|
||||||
|
DEVICE *dptr;
|
||||||
|
UNIT *uptr;
|
||||||
|
t_stat r;
|
||||||
|
t_bool explicit_device = FALSE;
|
||||||
|
|
||||||
GET_SWITCHES (cptr); /* get switches */
|
GET_SWITCHES (cptr); /* get switches */
|
||||||
if (sim_switches & SWMASK ('F'))
|
if (sim_switches & SWMASK ('F'))
|
||||||
flag = flag | SCP_HELP_FLAT;
|
flag = flag | SCP_HELP_FLAT;
|
||||||
if (*cptr) {
|
if (*cptr) {
|
||||||
cptr = get_glyph (cptr, gbuf, 0);
|
cptr = get_glyph (cptr, gbuf, 0);
|
||||||
|
|
||||||
|
if (0 == strcmp (gbuf, "DEVICE")) {
|
||||||
|
explicit_device = TRUE;
|
||||||
|
cptr = get_glyph (cptr, gbuf, 0);
|
||||||
|
}
|
||||||
|
dptr = find_unit (gbuf, &uptr);
|
||||||
|
if ((dptr == NULL) &&
|
||||||
|
((dptr = find_dev (gbuf)) == NULL)) {
|
||||||
|
if (explicit_device)
|
||||||
|
return sim_messagef (SCPE_ARG, "No such device %s\n", gbuf);
|
||||||
if ((cmdp = find_cmd (gbuf))) {
|
if ((cmdp = find_cmd (gbuf))) {
|
||||||
if (*cptr) {
|
if (*cptr) {
|
||||||
if ((cmdp->action == &set_cmd) || (cmdp->action == &show_cmd)) {
|
if ((cmdp->action == &set_cmd) || (cmdp->action == &show_cmd)) {
|
||||||
|
@ -3320,25 +3339,10 @@ if (*cptr) {
|
||||||
sim_printf ("No help available for the %s command\n", cmdp->name);
|
sim_printf ("No help available for the %s command\n", cmdp->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
DEVICE *dptr;
|
|
||||||
UNIT *uptr;
|
|
||||||
t_stat r;
|
|
||||||
t_bool explicit_device = FALSE;
|
|
||||||
|
|
||||||
if (0 == strcmp (gbuf, "DEVICE")) {
|
|
||||||
explicit_device = TRUE;
|
|
||||||
cptr = get_glyph (cptr, gbuf, 0);
|
|
||||||
}
|
}
|
||||||
dptr = find_unit (gbuf, &uptr);
|
else {
|
||||||
if (dptr == NULL) {
|
|
||||||
dptr = find_dev (gbuf);
|
|
||||||
if (dptr == NULL)
|
|
||||||
return sim_messagef (SCPE_ARG, "No HELP available for %s%s %s\n",
|
|
||||||
explicit_device ? "DEVICE " : "", gbuf, cptr);
|
|
||||||
if (dptr->flags & DEV_DISABLE)
|
if (dptr->flags & DEV_DISABLE)
|
||||||
sim_printf ("Device %s is currently disabled\n", dptr->name);
|
sim_printf ("Device %s is currently disabled\n", dptr->name);
|
||||||
}
|
|
||||||
r = help_dev_help (stdout, dptr, uptr, flag, cptr);
|
r = help_dev_help (stdout, dptr, uptr, flag, cptr);
|
||||||
if (sim_log)
|
if (sim_log)
|
||||||
help_dev_help (sim_log, dptr, uptr, flag | SCP_HELP_FLAT, cptr);
|
help_dev_help (sim_log, dptr, uptr, flag | SCP_HELP_FLAT, cptr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue