]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Allow passing library name with flag
authorGareth Evans <garoevans@gmail.com>
Tue, 25 Jun 2013 22:19:23 +0000 (15:19 -0700)
committerepriestley <git@epriestley.com>
Tue, 25 Jun 2013 22:20:30 +0000 (15:20 -0700)
Summary: Enables the process to pass the user input for library name. Fixes T3342

Test Plan: Little help... `arc liberate` doesn't run on windows. Though I saw the flag :)

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Maniphest Tasks: T3342

Differential Revision: https://secure.phabricator.com/D6306

src/workflow/ArcanistLiberateWorkflow.php

index 4df0499d00ef6c32597f75f3f98d5ee9449796fe..28d48ccf69a7bcc89d746b984de7762170754511 100644 (file)
@@ -45,6 +45,11 @@ EOTEXT
           "Force the library map to be updated, even in the presence of ".
           "lint errors.",
       ),
+      'library-name' => array(
+        'param' => 'name',
+        'help' =>
+          "Use a flag for library name rather than awaiting user input.",
+      ),
       'remap' => array(
         'hide' => true,
         'help' =>
@@ -203,7 +208,10 @@ EOTEXT
     echo "Creating new libphutil library in '{$path}'.\n";
     echo "Choose a name for the new library.\n";
     do {
-      $name = phutil_console_prompt('What do you want to name this library?');
+      $name = $this->getArgument("library-name");
+      if ($name === null) {
+        $name = phutil_console_prompt('What do you want to name this library?');
+      }
       if (preg_match('/^[a-z-]+$/', $name)) {
         break;
       } else {