]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[OPENSM] support standard windows cmd-line help request '/?'
authorStan Smith <stan.smith@intel.com>
Sat, 22 May 2010 00:11:23 +0000 (00:11 +0000)
committerStan Smith <stan.smith@intel.com>
Sat, 22 May 2010 00:11:23 +0000 (00:11 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1@2810 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/ulp/opensm/user/opensm/main.c
trunk/ulp/opensm/user/osmtest/main.c

index 3405867328917b739b366e9277823d2b06628937..e71d71727a2d1178fff0ee2ba5db23249ccba7b9 100644 (file)
@@ -616,7 +616,11 @@ opensm_main(void *OsmMainArgs)
        char *conf_template = NULL, *config_file = NULL;\r
        uint32_t val;\r
        const char *const short_option =\r
-           "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:";\r
+#ifdef __WIN__\r
+       "?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:";\r
+#else\r
+       "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:";\r
+#endif\r
 \r
        /*\r
           In the array below, the 2nd parameter specifies the number\r
@@ -719,15 +723,6 @@ opensm_main(void *OsmMainArgs)
                        config_file = optarg;\r
                        printf("Config file is `%s`:\n", config_file);\r
                        break;\r
-#ifdef __WIN__\r
-               /* stop here if option parsing problems.\r
-                * Allows error message to viewed and not lost in\r
-                * verbose usage output.\r
-                */\r
-               case ':':\r
-               case '?':\r
-                       exit(1);\r
-#endif\r
                default:\r
                        break;\r
                }\r
index b2e1cb82f8b8c1c7ce38bc38855a08d6449d3b9e..8b8b52b78bf35d273098dafecb1782243babfdd4 100644 (file)
@@ -286,7 +286,11 @@ int main(int argc, char *argv[])
        int32_t vendor_debug = 0;\r
        char flow_name[64];\r
        uint32_t next_option;\r
+#ifdef __WIN__\r
+       const char *const short_option = "?f:l:m:M:d:g:s:t:i:pcvVh";\r
+#else\r
        const char *const short_option = "f:l:m:M:d:g:s:t:i:pcvVh";\r
+#endif\r
 \r
        /*\r
         * In the array below, the 2nd parameter specified the number\r
@@ -316,13 +320,6 @@ int main(int argc, char *argv[])
                {NULL, 0, NULL, 0}      /* Required at end of array */\r
        };\r
 \r
-#ifdef __WIN__\r
-       if ( !strcmp(argv[1],"/?") ) {\r
-               show_usage();\r
-               return 0;\r
-       }\r
-#endif\r
-\r
        /* Make sure that the opensm, complib and osmtest were compiled using\r
           same modes (debug/free) */\r
        if (osm_is_debug() != cl_is_debug() || osm_is_debug() != osmt_is_debug()\r
@@ -559,6 +556,9 @@ int main(int argc, char *argv[])
                        }\r
                        break;\r
 \r
+#ifdef __WIN__\r
+               case '?':\r
+#endif\r
                case 'h':\r
                        show_usage();\r
                        return 0;\r