Dewey,
Yes definitely that should go in. If you do not have developer privileges to
check it into CVS, send me either the patch file or the source file and I
will check it in. I probably won't get to it until this weekend however.
Regards,
Eric
For consideration (trunk)
This patch adds --help option for emcrsh and shows some defaults values.
Example usage:
$ emcrsh --help
Usage:
emcrsh [Options] [-- emcOptions]
Options:
--help this help
--port <port number> (default=5007)
--name <server name> (default=EMCNETSVR)
--connectpw <password> (default=EMC)
--enablepw <password> (default=EMCTOO)
--sessions <max sessions> (default=-1) (-1 ==> no limit)
--path <path> (default=../../nc_files/)
emcOptions:
-ini <inifile> (default=emc.ini)
Index: emcrsh.cc
===================================================================
RCS file: /cvs/emc2/src/emc/usr_intf/emcrsh.cc,v
retrieving revision 1.16
diff -u -r1.16 emcrsh.cc
--- emcrsh.cc 8 Apr 2009 15:38:06 -0000 1.16
+++ emcrsh.cc 7 May 2009 20:30:40 -0000
@@ -489,6 +489,7 @@
const char *commands[] = {"HELLO", "SET", "GET", "QUIT", "SHUTDOWN",
"HELP", ""
};
struct option longopts[] = {
+ {"help", 0, NULL, 'h'},
{"port", 1, NULL, 'p'},
{"name", 1, NULL, 'n'},
{"sessions", 1, NULL, 's'},
@@ -2742,14 +2743,32 @@
programStartLine = 0;
}
+static void usage(char* pname) {
+ printf("Usage: \n");
+ printf(" %s [Options] [-- emcOptions]\n"
+ "Options:\n"
+ " --help this help\n"
+ " --port <port number> (default=%d)\n"
+ " --name <server name> (default=%s)\n"
+ " --connectpw <password> (default=%s)\n"
+ " --enablepw <password> (default=%s)\n"
+ " --sessions <max sessions> (default=%d) (-1 ==> no
limit)
\n"
+ " --path <path> (default=%s)\n"
+ "emcOptions:\n"
+ " -ini <inifile> (default=%s)\n"
+
,pname,port,serverName,pwd,enablePWD,maxSessions,defaultPath,EMC_INIF
ILE
+ );
+}
+
int main(int argc, char *argv[])
{
int opt;
initMain();
// process local command line args
- while((opt = getopt_long(argc, argv, "e:n:p:s:w:d:", longopts, NULL))
!= -1
) {
+ while((opt = getopt_long(argc, argv, "he:n:p:s:w:d:", longopts, NULL))
!= -
1) {
switch(opt) {
+ case 'h': usage(argv[0]); exit(1);
case 'e': strncpy(enablePWD, optarg, strlen(optarg) + 1); break;
case 'n': strncpy(serverName, optarg, strlen(optarg) + 1); break;
case 'p': sscanf(optarg, "%d", &port); break;
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers