Re: Usage text on Windows shows the wrong list separator

Bart Van Assche <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 12/29/12 02:07, Jason McCollum wrote:
> In Windows, you have to use semi-colon ';' to separate things for the -m and -M options, but the usage text says to use a colon.  Here's a patch to fix the text:
> 
> diff -rup net-snmp-5.7.2-original/snmplib/snmp_parse_args.c net-snmp-5.7.2/snmplib/snmp_parse_args.c
> --- net-snmp-5.7.2-original/snmplib/snmp_parse_args.c	2012-12-28 17:24:04.436295000 -0700
> +++ net-snmp-5.7.2/snmplib/snmp_parse_args.c	2012-12-28 17:09:06.931830000 -0700
> @@ -128,9 +128,9 @@ snmp_parse_args_descriptions(FILE * outf
> 			 "  -D[TOKEN[,...]]\tturn on debugging output for the specified TOKENs\n\t\t\t   (ALL gives extremely verbose debugging output)\n");
> 	 fprintf(outf, "General options\n");
> 	 fprintf(outf,
> -		    "  -m MIB[:...]\t\tload given list of MIBs (ALL loads everything)\n");
> +		    "  -m MIB[%c...]\t\tload given list of MIBs (ALL loads everything)\n", ENV_SEPARATOR_CHAR);
> 	 fprintf(outf,
> -		    "  -M DIR[:...]\t\tlook in given list of directories for MIBs\n");
> +		    "  -M DIR[%c...]\t\tlook in given list of directories for MIBs\n", ENV_SEPARATOR_CHAR);
> #ifndef NETSNMP_DISABLE_MIB_LOADING
> 	 fprintf(outf,
> 			 "    (default: %s)\n", netsnmp_get_mib_directory());

Thanks for reporting this. However, you might have missed some cases.
How about the patch below ?

[PATCH] CHANGES: Windows: Fix environment separator in snmpd/snmptrapd/snmptranslate help text.

---
 apps/snmptranslate.c      |    4 ++--
 net-snmp-config.in        |    4 ++--
 snmplib/snmp_parse_args.c |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/apps/snmptranslate.c b/apps/snmptranslate.c
index 62ecce7..1ef9193 100644
--- a/apps/snmptranslate.c
+++ b/apps/snmptranslate.c
@@ -75,9 +75,9 @@ usage(void)
     fprintf(stderr, "  -h\t\t\tdisplay this help message\n");
     fprintf(stderr, "  -V\t\t\tdisplay package version number\n");
     fprintf(stderr,
-            "  -m MIB[:...]\t\tload given list of MIBs (ALL loads everything)\n");
+            "  -m MIB[" ENV_SEPARATOR "...]\t\tload given list of MIBs (ALL loads everything)\n");
     fprintf(stderr,
-            "  -M DIR[:...]\t\tlook in given list of directories for MIBs\n");
+            "  -M DIR[" ENV_SEPARATOR "...]\t\tlook in given list of directories for MIBs\n");
     fprintf(stderr,
             "  -D[TOKEN[,...]]\tturn on debugging output for the specified TOKENs\n\t\t\t   (ALL gives extremely verbose debugging output)\n");
     fprintf(stderr, "  -w WIDTH\t\tset width of tree and detail output\n");
diff --git a/net-snmp-config.in b/net-snmp-config.in
index 28c9306..330f660 100644
--- a/net-snmp-config.in
+++ b/net-snmp-config.in
@@ -459,9 +459,9 @@ usage(const char *prog)
     snmp_log_options_usage("\t\t\t  ", stderr);
 #ifndef DISABLE_MIB_LOADING
     fprintf(stderr,
-            "  -m MIB[:...]\t\tload given list of MIBs (ALL loads "
+            "  -m MIB[" ENV_SEPARATOR "...]\t\tload given list of MIBs (ALL loads "
             "everything)\n"
-            "  -M DIR[:...]\t\tlook in given list of directories for MIBs\n");
+            "  -M DIR[" ENV_SEPARATOR "...]\t\tlook in given list of directories for MIBs\n");
 #endif /* DISABLE_MIB_LOADING */
 #ifndef DISABLE_MIB_LOADING
     fprintf(stderr,
diff --git a/snmplib/snmp_parse_args.c b/snmplib/snmp_parse_args.c
index d939807..a003995 100644
--- a/snmplib/snmp_parse_args.c
+++ b/snmplib/snmp_parse_args.c
@@ -134,9 +134,9 @@ snmp_parse_args_descriptions(FILE * outf)
             "  -D[TOKEN[,...]]\tturn on debugging output for the specified TOKENs\n\t\t\t   (ALL gives extremely verbose debugging output)\n");
     fprintf(outf, "General options\n");
     fprintf(outf,
-            "  -m MIB[:...]\t\tload given list of MIBs (ALL loads everything)\n");
+            "  -m MIB[" ENV_SEPARATOR "...]\t\tload given list of MIBs (ALL loads everything)\n");
     fprintf(outf,
-            "  -M DIR[:...]\t\tlook in given list of directories for MIBs\n");
+            "  -M DIR[" ENV_SEPARATOR "...]\t\tlook in given list of directories for MIBs\n");
 #ifndef NETSNMP_DISABLE_MIB_LOADING
     fprintf(outf,
             "  -P MIBOPTS\t\tToggle various defaults controlling MIB parsing:\n");
-- 
1.7.10.4




------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.