소스 검색

Merge pull request #322 from ishland/patch-4

Add commands error
walkor 7 년 전
부모
커밋
be11adf096
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      Worker.php

+ 2 - 1
Worker.php

@@ -668,7 +668,6 @@ class Worker
 
     /**
      * Parse command.
-     * php yourfile.php start | stop | restart | reload | status [-d]
      *
      * @return void
      */
@@ -690,6 +689,7 @@ class Worker
         );
         $usage = "Usage: php yourfile <command> [mode]\nCommands: \nstart\t\tStart worker in DEBUG mode.\n\t\tUse mode -d to start in DAEMON mode.\nstop\t\tStop worker.\n\t\tUse mode -g to stop gracefully.\nrestart\t\tRestart workers.\n\t\tUse mode -d to start in DAEMON mode.\n\t\tUse mode -g to stop gracefully.\nreload\t\tReload codes.\n\t\tUse mode -g to reload gracefully.\nstatus\t\tGet worker status.\n\t\tUse mode -d to show live status.\nconnections\tGet worker connections.\n";
         if (!isset($argv[1]) || !in_array($argv[1], $available_commands)) {
+	    if (isset($argv[1])) echo 'Unknown command: ' . $argv[1] . "\n";
             exit($usage);
         }
 
@@ -810,6 +810,7 @@ class Worker
                 posix_kill($master_pid, $sig);
                 exit;
             default :
+		if (isset($command)) echo 'Unknown command: ' . $command . "\n";
                 exit($usage);
         }
     }