Przeglądaj źródła

changed the default version if nothing is provided by the developer

Fabien Potencier 15 lat temu
rodzic
commit
1e3e8c760e
1 zmienionych plików z 8 dodań i 1 usunięć
  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()
   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>';
+    }
   }
   }
 
 
   /**
   /**