changeset 1104:3e7cb5546075 draft

option fix.
author tkaito
date Sun, 02 Jan 2011 20:59:12 +0900
parents de43f312b51f
children f80524d00a2c
files TaskManager/kernel/main.cc
diffstat 1 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/kernel/main.cc	Fri Dec 31 17:22:33 2010 +0900
+++ b/TaskManager/kernel/main.cc	Sun Jan 02 20:59:12 2011 +0900
@@ -42,7 +42,14 @@
 	    profile = 1;
         } else if (strcmp(argv[i], "-speidle") == 0) {
 	    speIdle = atoi(argv[++i]);
-	}
+	} else if (strcmp(argv[i], "-help") == 0) {
+	    if (usr_help_str) {
+		manager->get_scheduler()->printf("%s", usr_help_str);
+	    }
+	    manager->get_scheduler()->printf("%s", help_str);	    
+	    return EXIT_SUCCESS;
+        }
+
     }
 
     TaskManager *manager = new TaskManager(machineNum);
@@ -50,15 +57,6 @@
 
     manager->set_TMend(defaultTMend);
 
-    for (int i = 1; argv[i]; ++i) {
-        if (strcmp(argv[i], "-help") == 0) {
-	    if (usr_help_str) {
-		manager->get_scheduler()->printf("%s", usr_help_str);
-	    }
-	    manager->get_scheduler()->printf("%s", help_str);	    
-	    return EXIT_SUCCESS;
-        }
-    }
     if (profile)
 	manager->start_profile();
     if (TMmain(manager, argc, argv) < 0) {