Skip to content
Snippets Groups Projects
Commit 5d33e2a3 authored by rswindell's avatar rswindell
Browse files

Add a string command (e.g. sysop command) parameter history (persisted in

bbs.mods.str_cmds_parameter_history): the sysop can use the up/down arrow
keys to scroll back through command parameter history (for the current
login-session).
parent f6e34d37
No related branches found
No related tags found
No related merge requests found
......@@ -835,15 +835,22 @@ function str_cmds(str)
//### Generic routine to ask user for parameter if one wasn't specified ###
function get_arg(str, parm)
function get_arg(str, parm, history)
{
if(!history) {
if(!bbs.mods.str_cmds_parameter_history)
bbs.mods.str_cmds_parameter_history = [];
history = bbs.mods.str_cmds_parameter_history;
}
if(parm == undefined)
parm = "Parameter(s)";
str=str.replace(/^\s+/,"");
if(str=="") {
write(format("%s: ", parm));
str=console.getstr();
str=console.getstr(history);
}
if(str && history.indexOf(str) < 0)
history.unshift(str);
return(str);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment