From ca4ae97f75c476ed387d2162d93e1c2eddebd657 Mon Sep 17 00:00:00 2001 From: Stan Smith Date: Sat, 22 May 2010 00:11:23 +0000 Subject: [PATCH] [OPENSM] support standard windows cmd-line help request '/?' git-svn-id: svn://openib.tc.cornell.edu/gen1@2810 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/ulp/opensm/user/opensm/main.c | 15 +++++---------- trunk/ulp/opensm/user/osmtest/main.c | 14 +++++++------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/trunk/ulp/opensm/user/opensm/main.c b/trunk/ulp/opensm/user/opensm/main.c index 34058673..e71d7172 100644 --- a/trunk/ulp/opensm/user/opensm/main.c +++ b/trunk/ulp/opensm/user/opensm/main.c @@ -616,7 +616,11 @@ opensm_main(void *OsmMainArgs) char *conf_template = NULL, *config_file = NULL; uint32_t val; const char *const short_option = - "F:c:i:w:f:ed:D:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:ANBIQvVhoryxp:n:q:k:C:G:H:"; +#ifdef __WIN__ + "?F:c:i:w:f:ed:D:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:ANBIQvVhoryxp:n:q:k:C:G:H:"; +#else + "F:c:i:w:f:ed:D:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:ANBIQvVhoryxp:n:q:k:C:G:H:"; +#endif /* In the array below, the 2nd parameter specifies the number @@ -719,15 +723,6 @@ opensm_main(void *OsmMainArgs) config_file = optarg; printf("Config file is `%s`:\n", config_file); break; -#ifdef __WIN__ - /* stop here if option parsing problems. - * Allows error message to viewed and not lost in - * verbose usage output. - */ - case ':': - case '?': - exit(1); -#endif default: break; } diff --git a/trunk/ulp/opensm/user/osmtest/main.c b/trunk/ulp/opensm/user/osmtest/main.c index b2e1cb82..8b8b52b7 100644 --- a/trunk/ulp/opensm/user/osmtest/main.c +++ b/trunk/ulp/opensm/user/osmtest/main.c @@ -286,7 +286,11 @@ int main(int argc, char *argv[]) int32_t vendor_debug = 0; char flow_name[64]; uint32_t next_option; +#ifdef __WIN__ + const char *const short_option = "?f:l:m:M:d:g:s:t:i:pcvVh"; +#else const char *const short_option = "f:l:m:M:d:g:s:t:i:pcvVh"; +#endif /* * In the array below, the 2nd parameter specified the number @@ -316,13 +320,6 @@ int main(int argc, char *argv[]) {NULL, 0, NULL, 0} /* Required at end of array */ }; -#ifdef __WIN__ - if ( !strcmp(argv[1],"/?") ) { - show_usage(); - return 0; - } -#endif - /* Make sure that the opensm, complib and osmtest were compiled using same modes (debug/free) */ if (osm_is_debug() != cl_is_debug() || osm_is_debug() != osmt_is_debug() @@ -559,6 +556,9 @@ int main(int argc, char *argv[]) } break; +#ifdef __WIN__ + case '?': +#endif case 'h': show_usage(); return 0; -- 2.41.0