浏览代码

changed the default version if nothing is provided by the developer

Fabien Potencier 15 年之前
父节点
当前提交
1e3e8c760e
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      src/Symfony/Components/CLI/Application.php

+ 8 - 1
src/Symfony/Components/CLI/Application.php

@@ -304,7 +304,14 @@ class Application
    */
   public function getLongVersion()
   {
-    return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
+    if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion())
+    {
+      return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
+    }
+    else
+    {
+      return '<info>CLI Tool</info>';
+    }
   }
 
   /**