Browse Source

Let the usage shows to users the second optional available argument -d

farwish 8 years ago
parent
commit
08286d8d73
1 changed files with 4 additions and 3 deletions
  1. 4 3
      Worker.php

+ 4 - 3
Worker.php

@@ -614,7 +614,7 @@ class Worker
 
     /**
      * Parse command.
-     * php yourfile.php start | stop | restart | reload | status
+     * php yourfile.php start | stop | restart | reload | status [-d]
      *
      * @return void
      */
@@ -631,8 +631,9 @@ class Worker
             'status',
             'connections',
         );
+        $usage = "Usage: php yourfile.php {" . implode('|', $available_commands) . "} [-d]\n";
         if (!isset($argv[1]) || !in_array($argv[1], $available_commands)) {
-            exit("Usage: php yourfile.php {" . implode('|', $available_commands) . "}\n");
+            exit($usage);
         }
 
         // Get command.
@@ -734,7 +735,7 @@ class Worker
                 self::log("Workerman[$start_file] reload");
                 exit;
             default :
-                exit("Usage: php yourfile.php {" . implode('|', $available_commands) . "}\n");
+                exit($usage);
         }
     }