Commit 34f21397 authored by rswindell's avatar rswindell
Browse files

Added common command-line specifier list/descriptions to online help for all

configurable command-lines.
parent 902ada66
...@@ -47,6 +47,26 @@ ...@@ -47,6 +47,26 @@
#define SETHELP(where) uifc.sethelp(where) #define SETHELP(where) uifc.sethelp(where)
#define SCFG_CMDLINE_SPEC_HELP "\n" \
"The following is a list of commonly-used command-line specifiers:\n" \
"\n" \
" `%f` The path/filename of the file to act upon or door/game drop file\n" \
" `%s` File specification (e.g. `*.txt`) or the current `Startup Directory`\n" \
" `%!` The Synchronet `exec` directory (use `%@` for non-Unix only)\n" \
" `%.` Executable file extension (`.exe`, or blank for Unix systems)\n" \
" `%n` The current node directory\n" \
" `%#` The current node number\n" \
" `%a` The current user's alias\n" \
" `%1` The current user's number (use `%2`, `%3`, etc. for 0-padded values)\n" \
" `%h` The current TCP/IP socket descriptor (handle) value\n" \
" `%p` The current connection type (protocol, e.g. `telnet`, `rlogin`, etc.)\n" \
" `%r` The current user's terminal height (rows)\n" \
" `%w` The current user's terminal width (columns)\n" \
"\n" \
"For a complete list of the supported command-line specifiers, see:\n" \
"`http://wiki.synchro.net/config:cmdline`\n"
/*************/ /*************/
/* Constants */ /* Constants */
/*************/ /*************/
......
...@@ -75,6 +75,7 @@ void page_cfg() ...@@ -75,6 +75,7 @@ void page_cfg()
"`External Chat Pager Command Line:`\n" "`External Chat Pager Command Line:`\n"
"\n" "\n"
"This is the command line to execute for this external chat pager.\n" "This is the command line to execute for this external chat pager.\n"
SCFG_CMDLINE_SPEC_HELP
; ;
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Command Line",str,50 if(uifc.input(WIN_MID|WIN_SAV,0,0,"Command Line",str,50
,K_EDIT)<1) ,K_EDIT)<1)
...@@ -140,6 +141,7 @@ void page_cfg() ...@@ -140,6 +141,7 @@ void page_cfg()
"`External Chat Pager Command Line:`\n" "`External Chat Pager Command Line:`\n"
"\n" "\n"
"This is the command line to execute for this external chat pager.\n" "This is the command line to execute for this external chat pager.\n"
SCFG_CMDLINE_SPEC_HELP
; ;
strcpy(str,cfg.page[i]->cmd); strcpy(str,cfg.page[i]->cmd);
if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Command Line" if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Command Line"
......
...@@ -242,8 +242,8 @@ void xfer_opts() ...@@ -242,8 +242,8 @@ void xfer_opts()
"`Viewable File Types:`\n" "`Viewable File Types:`\n"
"\n" "\n"
"This is a list of file types that have content information that can be\n" "This is a list of file types that have content information that can be\n"
"viewed through the execution of an external program. Here are a couple of\n" "viewed on the Terminal Server through the execution of an external\n"
"command line examples for a few file types.\n" "program."
; ;
i=uifc.list(i,0,0,50,&fview_dflt,NULL,"Viewable File Types",opt); i=uifc.list(i,0,0,50,&fview_dflt,NULL,"Viewable File Types",opt);
if(i==-1) if(i==-1)
...@@ -330,6 +330,7 @@ void xfer_opts() ...@@ -330,6 +330,7 @@ void xfer_opts()
,cfg.fview[i]->ext,sizeof(cfg.fview[i]->ext)-1,K_EDIT); ,cfg.fview[i]->ext,sizeof(cfg.fview[i]->ext)-1,K_EDIT);
break; break;
case 1: case 1:
uifc.helpbuf = SCFG_CMDLINE_SPEC_HELP;
uifc.input(WIN_MID|WIN_SAV,0,0 uifc.input(WIN_MID|WIN_SAV,0,0
,"Command" ,"Command"
,cfg.fview[i]->cmd,sizeof(cfg.fview[i]->cmd)-1,K_EDIT); ,cfg.fview[i]->cmd,sizeof(cfg.fview[i]->cmd)-1,K_EDIT);
...@@ -361,7 +362,7 @@ void xfer_opts() ...@@ -361,7 +362,7 @@ void xfer_opts()
"This is a list of file types that will have a command line executed to\n" "This is a list of file types that will have a command line executed to\n"
"test the file integrity upon their upload. The file types are specified\n" "test the file integrity upon their upload. The file types are specified\n"
"by `extension` and if one file extension is listed more than once, each\n" "by `extension` and if one file extension is listed more than once, each\n"
"command line will be executed. The command lines must return a DOS error\n" "command line will be executed. The command lines must return a error\n"
"code of 0 (no error) in order for the file to pass the test. This method\n" "code of 0 (no error) in order for the file to pass the test. This method\n"
"of file testing upon upload is also known as an upload event. This test\n" "of file testing upon upload is also known as an upload event. This test\n"
"or event, can do more than just test the file, it can perform any\n" "or event, can do more than just test the file, it can perform any\n"
...@@ -460,6 +461,7 @@ void xfer_opts() ...@@ -460,6 +461,7 @@ void xfer_opts()
,cfg.ftest[i]->ext,sizeof(cfg.ftest[i]->ext)-1,K_EDIT); ,cfg.ftest[i]->ext,sizeof(cfg.ftest[i]->ext)-1,K_EDIT);
break; break;
case 1: case 1:
uifc.helpbuf = SCFG_CMDLINE_SPEC_HELP;
uifc.input(WIN_MID|WIN_SAV,0,0 uifc.input(WIN_MID|WIN_SAV,0,0
,"Command" ,"Command"
,cfg.ftest[i]->cmd,sizeof(cfg.ftest[i]->cmd)-1,K_EDIT); ,cfg.ftest[i]->cmd,sizeof(cfg.ftest[i]->cmd)-1,K_EDIT);
...@@ -496,7 +498,7 @@ void xfer_opts() ...@@ -496,7 +498,7 @@ void xfer_opts()
"perform an event upon their download (e.g. trigger a download event).\n" "perform an event upon their download (e.g. trigger a download event).\n"
"The file types are specified by `extension` and if one file extension\n" "The file types are specified by `extension` and if one file extension\n"
"is listed more than once, each command line will be executed. The\n" "is listed more than once, each command line will be executed. The\n"
"command lines must return a DOS error code of 0 (no error) in order\n" "command lines must return a error level of 0 (no error) in order\n"
"for the file to pass the test. This test or event, can do more than\n" "for the file to pass the test. This test or event, can do more than\n"
"just test the file, it can perform any function that the sysop wishes.\n" "just test the file, it can perform any function that the sysop wishes.\n"
"Such as adding comments to an archived file, or extracting an archive\n" "Such as adding comments to an archived file, or extracting an archive\n"
...@@ -593,6 +595,7 @@ void xfer_opts() ...@@ -593,6 +595,7 @@ void xfer_opts()
,cfg.dlevent[i]->ext,sizeof(cfg.dlevent[i]->ext)-1,K_EDIT); ,cfg.dlevent[i]->ext,sizeof(cfg.dlevent[i]->ext)-1,K_EDIT);
break; break;
case 1: case 1:
uifc.helpbuf = SCFG_CMDLINE_SPEC_HELP;
uifc.input(WIN_MID|WIN_SAV,0,0 uifc.input(WIN_MID|WIN_SAV,0,0
,"Command" ,"Command"
,cfg.dlevent[i]->cmd,sizeof(cfg.dlevent[i]->cmd)-1,K_EDIT); ,cfg.dlevent[i]->cmd,sizeof(cfg.dlevent[i]->cmd)-1,K_EDIT);
...@@ -717,6 +720,7 @@ void xfer_opts() ...@@ -717,6 +720,7 @@ void xfer_opts()
,cfg.fextr[i]->ext,sizeof(cfg.fextr[i]->ext)-1,K_EDIT); ,cfg.fextr[i]->ext,sizeof(cfg.fextr[i]->ext)-1,K_EDIT);
break; break;
case 1: case 1:
uifc.helpbuf = SCFG_CMDLINE_SPEC_HELP;
uifc.input(WIN_MID|WIN_SAV,0,0 uifc.input(WIN_MID|WIN_SAV,0,0
,"Command" ,"Command"
,cfg.fextr[i]->cmd,sizeof(cfg.fextr[i]->cmd)-1,K_EDIT); ,cfg.fextr[i]->cmd,sizeof(cfg.fextr[i]->cmd)-1,K_EDIT);
...@@ -834,6 +838,7 @@ void xfer_opts() ...@@ -834,6 +838,7 @@ void xfer_opts()
,cfg.fcomp[i]->ext,sizeof(cfg.fcomp[i]->ext)-1,K_EDIT); ,cfg.fcomp[i]->ext,sizeof(cfg.fcomp[i]->ext)-1,K_EDIT);
break; break;
case 1: case 1:
uifc.helpbuf = SCFG_CMDLINE_SPEC_HELP;
uifc.input(WIN_MID|WIN_SAV,0,0 uifc.input(WIN_MID|WIN_SAV,0,0
,"Command" ,"Command"
,cfg.fcomp[i]->cmd,sizeof(cfg.fcomp[i]->cmd)-1,K_EDIT); ,cfg.fcomp[i]->cmd,sizeof(cfg.fcomp[i]->cmd)-1,K_EDIT);
...@@ -986,26 +991,31 @@ void xfer_opts() ...@@ -986,26 +991,31 @@ void xfer_opts()
getar(str,cfg.prot[i]->arstr); getar(str,cfg.prot[i]->arstr);
break; break;
case 3: case 3:
uifc.helpbuf = SCFG_CMDLINE_SPEC_HELP;
uifc.input(WIN_MID|WIN_SAV,0,0 uifc.input(WIN_MID|WIN_SAV,0,0
,"Command" ,"Command"
,cfg.prot[i]->ulcmd,sizeof(cfg.prot[i]->ulcmd)-1,K_EDIT); ,cfg.prot[i]->ulcmd,sizeof(cfg.prot[i]->ulcmd)-1,K_EDIT);
break; break;
case 4: case 4:
uifc.helpbuf = SCFG_CMDLINE_SPEC_HELP;
uifc.input(WIN_MID|WIN_SAV,0,0 uifc.input(WIN_MID|WIN_SAV,0,0
,"Command" ,"Command"
,cfg.prot[i]->dlcmd,sizeof(cfg.prot[i]->dlcmd)-1,K_EDIT); ,cfg.prot[i]->dlcmd,sizeof(cfg.prot[i]->dlcmd)-1,K_EDIT);
break; break;
case 5: case 5:
uifc.helpbuf = SCFG_CMDLINE_SPEC_HELP;
uifc.input(WIN_MID|WIN_SAV,0,0 uifc.input(WIN_MID|WIN_SAV,0,0
,"Command" ,"Command"
,cfg.prot[i]->batulcmd,sizeof(cfg.prot[i]->batulcmd)-1,K_EDIT); ,cfg.prot[i]->batulcmd,sizeof(cfg.prot[i]->batulcmd)-1,K_EDIT);
break; break;
case 6: case 6:
uifc.helpbuf = SCFG_CMDLINE_SPEC_HELP;
uifc.input(WIN_MID|WIN_SAV,0,0 uifc.input(WIN_MID|WIN_SAV,0,0
,"Command" ,"Command"
,cfg.prot[i]->batdlcmd,sizeof(cfg.prot[i]->batdlcmd)-1,K_EDIT); ,cfg.prot[i]->batdlcmd,sizeof(cfg.prot[i]->batdlcmd)-1,K_EDIT);
break; break;
case 7: case 7:
uifc.helpbuf = SCFG_CMDLINE_SPEC_HELP;
uifc.input(WIN_MID|WIN_SAV,0,0 uifc.input(WIN_MID|WIN_SAV,0,0
,"Command" ,"Command"
,cfg.prot[i]->bicmd,sizeof(cfg.prot[i]->bicmd)-1,K_EDIT); ,cfg.prot[i]->bicmd,sizeof(cfg.prot[i]->bicmd)-1,K_EDIT);
......
...@@ -361,6 +361,7 @@ void fevents_cfg() ...@@ -361,6 +361,7 @@ void fevents_cfg()
"in the logon sequence of users that includes interaction or requires\n" "in the logon sequence of users that includes interaction or requires\n"
"account information, you probably want to use an online external\n" "account information, you probably want to use an online external\n"
"program configured to run as a logon event.\n" "program configured to run as a logon event.\n"
SCFG_CMDLINE_SPEC_HELP
; ;
uifc.input(WIN_MID|WIN_SAV,0,0,"Logon Event" uifc.input(WIN_MID|WIN_SAV,0,0,"Logon Event"
,cfg.sys_logon,sizeof(cfg.sys_logon)-1,K_EDIT); ,cfg.sys_logon,sizeof(cfg.sys_logon)-1,K_EDIT);
...@@ -375,6 +376,7 @@ void fevents_cfg() ...@@ -375,6 +376,7 @@ void fevents_cfg()
"wish to have a program execute before carrier is dropped, you probably\n" "wish to have a program execute before carrier is dropped, you probably\n"
"want to use an `Online External Program` configured to run as a logoff\n" "want to use an `Online External Program` configured to run as a logoff\n"
"event.\n" "event.\n"
SCFG_CMDLINE_SPEC_HELP
; ;
uifc.input(WIN_MID|WIN_SAV,0,0,"Logout Event" uifc.input(WIN_MID|WIN_SAV,0,0,"Logout Event"
,cfg.sys_logout,sizeof(cfg.sys_logout)-1,K_EDIT); ,cfg.sys_logout,sizeof(cfg.sys_logout)-1,K_EDIT);
...@@ -385,6 +387,7 @@ void fevents_cfg() ...@@ -385,6 +387,7 @@ void fevents_cfg()
"\n" "\n"
"This is the command line for a program that will run after the first\n" "This is the command line for a program that will run after the first\n"
"user that logs on after midnight, logs off (regardless of what node).\n" "user that logs on after midnight, logs off (regardless of what node).\n"
SCFG_CMDLINE_SPEC_HELP
; ;
uifc.input(WIN_MID|WIN_SAV,0,0,"Daily Event" uifc.input(WIN_MID|WIN_SAV,0,0,"Daily Event"
,cfg.sys_daily,sizeof(cfg.sys_daily)-1,K_EDIT); ,cfg.sys_daily,sizeof(cfg.sys_daily)-1,K_EDIT);
...@@ -510,10 +513,6 @@ void tevents_cfg() ...@@ -510,10 +513,6 @@ void tevents_cfg()
"external program that performs some type of automated function on the\n" "external program that performs some type of automated function on the\n"
"system. Use this menu to configure how and when this event will be\n" "system. Use this menu to configure how and when this event will be\n"
"executed.\n" "executed.\n"
"\n"
"If you need the BBS to swap out of memory for this event (to make more\n"
"available memory), add the program name (first word of the command line)\n"
"to `Global Swap List` from the `External Programs` menu.\n"
; ;
sprintf(str,"%s Timed Event",cfg.event[i]->code); sprintf(str,"%s Timed Event",cfg.event[i]->code);
switch(uifc.list(WIN_SAV|WIN_ACT|WIN_L2R|WIN_BOT,0,0,70,&dfltopt,0 switch(uifc.list(WIN_SAV|WIN_ACT|WIN_L2R|WIN_BOT,0,0,70,&dfltopt,0
...@@ -528,7 +527,7 @@ void tevents_cfg() ...@@ -528,7 +527,7 @@ void tevents_cfg()
"\n" "\n"
"Every timed event must have its own unique internal code for Synchronet\n" "Every timed event must have its own unique internal code for Synchronet\n"
"to reference it by. It is helpful if this code is an abbreviation of the\n" "to reference it by. It is helpful if this code is an abbreviation of the\n"
"command line.\n" "command line or program name.\n"
; ;
uifc.input(WIN_MID|WIN_SAV,0,17,"Internal Code (unique)" uifc.input(WIN_MID|WIN_SAV,0,17,"Internal Code (unique)"
,str,LEN_CODE,K_EDIT|K_UPPER); ,str,LEN_CODE,K_EDIT|K_UPPER);
...@@ -549,9 +548,6 @@ void tevents_cfg() ...@@ -549,9 +548,6 @@ void tevents_cfg()
"before the event's command line is executed. This eliminates the need\n" "before the event's command line is executed. This eliminates the need\n"
"for batch files that just change the current drive and directory before\n" "for batch files that just change the current drive and directory before\n"
"executing the event.\n" "executing the event.\n"
"\n"
"If this option is not used, the current NODE's directory will be the\n"
"current DOS drive/directory before the command line is executed.\n"
; ;
uifc.input(WIN_MID|WIN_SAV,0,10,"Directory" uifc.input(WIN_MID|WIN_SAV,0,10,"Directory"
,cfg.event[i]->dir,sizeof(cfg.event[i]->dir)-1,K_EDIT); ,cfg.event[i]->dir,sizeof(cfg.event[i]->dir)-1,K_EDIT);
...@@ -561,6 +557,7 @@ void tevents_cfg() ...@@ -561,6 +557,7 @@ void tevents_cfg()
"`Timed Event Command Line:`\n" "`Timed Event Command Line:`\n"
"\n" "\n"
"This is the command line to execute upon this timed event.\n" "This is the command line to execute upon this timed event.\n"
SCFG_CMDLINE_SPEC_HELP
; ;
uifc.input(WIN_MID|WIN_SAV,0,10,"Command" uifc.input(WIN_MID|WIN_SAV,0,10,"Command"
,cfg.event[i]->cmd,sizeof(cfg.event[i]->cmd)-1,K_EDIT); ,cfg.event[i]->cmd,sizeof(cfg.event[i]->cmd)-1,K_EDIT);
...@@ -1068,9 +1065,6 @@ void xtrn_cfg(uint section) ...@@ -1068,9 +1065,6 @@ void xtrn_cfg(uint section)
"before the program's command line is executed. This eliminates the need\n" "before the program's command line is executed. This eliminates the need\n"
"for batch files that just change the current drive and directory before\n" "for batch files that just change the current drive and directory before\n"
"executing the program.\n" "executing the program.\n"
"\n"
"If this option is not used, the current NODE's directory will be the\n"
"current DOS drive/directory before the command line is executed.\n"
; ;
uifc.input(WIN_MID|WIN_SAV,0,10,"" uifc.input(WIN_MID|WIN_SAV,0,10,""
,cfg.xtrn[i]->path,sizeof(cfg.xtrn[i]->path)-1,K_EDIT); ,cfg.xtrn[i]->path,sizeof(cfg.xtrn[i]->path)-1,K_EDIT);
...@@ -1080,6 +1074,7 @@ void xtrn_cfg(uint section) ...@@ -1080,6 +1074,7 @@ void xtrn_cfg(uint section)
"`Online Program Command Line:`\n" "`Online Program Command Line:`\n"
"\n" "\n"
"This is the command line to execute to run the online program.\n" "This is the command line to execute to run the online program.\n"
SCFG_CMDLINE_SPEC_HELP
; ;
uifc.input(WIN_MID|WIN_SAV,0,10,"Command" uifc.input(WIN_MID|WIN_SAV,0,10,"Command"
,cfg.xtrn[i]->cmd,sizeof(cfg.xtrn[i]->cmd)-1,K_EDIT); ,cfg.xtrn[i]->cmd,sizeof(cfg.xtrn[i]->cmd)-1,K_EDIT);
...@@ -1090,6 +1085,7 @@ void xtrn_cfg(uint section) ...@@ -1090,6 +1085,7 @@ void xtrn_cfg(uint section)
"\n" "\n"
"This is the command line to execute after the main command line. This\n" "This is the command line to execute after the main command line. This\n"
"option is usually only used for multiuser online programs.\n" "option is usually only used for multiuser online programs.\n"
SCFG_CMDLINE_SPEC_HELP
; ;
uifc.input(WIN_MID|WIN_SAV,0,10,"Clean-up" uifc.input(WIN_MID|WIN_SAV,0,10,"Clean-up"
,cfg.xtrn[i]->clean,sizeof(cfg.xtrn[i]->clean)-1,K_EDIT); ,cfg.xtrn[i]->clean,sizeof(cfg.xtrn[i]->clean)-1,K_EDIT);
...@@ -1702,6 +1698,7 @@ void xedit_cfg() ...@@ -1702,6 +1698,7 @@ void xedit_cfg()
"`External Editor Command Line:`\n" "`External Editor Command Line:`\n"
"\n" "\n"
"This is the command line to execute when using this editor.\n" "This is the command line to execute when using this editor.\n"
SCFG_CMDLINE_SPEC_HELP
; ;
uifc.input(WIN_MID|WIN_SAV,0,10,"Command" uifc.input(WIN_MID|WIN_SAV,0,10,"Command"
,cfg.xedit[i]->rcmd,sizeof(cfg.xedit[i]->rcmd)-1,K_EDIT); ,cfg.xedit[i]->rcmd,sizeof(cfg.xedit[i]->rcmd)-1,K_EDIT);
...@@ -2382,6 +2379,7 @@ void hotkey_cfg(void) ...@@ -2382,6 +2379,7 @@ void hotkey_cfg(void)
"`Hot Key Event Command Line:`\n" "`Hot Key Event Command Line:`\n"
"\n" "\n"
"This is the command line to execute when this hot key is pressed.\n" "This is the command line to execute when this hot key is pressed.\n"
SCFG_CMDLINE_SPEC_HELP
; ;
uifc.input(WIN_MID|WIN_SAV,0,10,"Command" uifc.input(WIN_MID|WIN_SAV,0,10,"Command"
,cfg.hotkey[i]->cmd,sizeof(cfg.hotkey[i]->cmd)-1,K_EDIT); ,cfg.hotkey[i]->cmd,sizeof(cfg.hotkey[i]->cmd)-1,K_EDIT);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment