]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Allow hyphens in arc library names
authorNick Harper <nharper@fb.com>
Thu, 26 Jul 2012 01:37:25 +0000 (18:37 -0700)
committerNick Harper <nharper@fb.com>
Thu, 26 Jul 2012 01:37:25 +0000 (18:37 -0700)
Summary:
We've had these in our library names and they're quite useful as word
separators. Allowing them shouldn't cause any trouble.

Test Plan:
ran arc liberate in an empty directory, and it didn't complain when I gave
it a name with a hyphen.

Reviewers: epriestley, vrana, jungejason

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D3070

src/workflow/ArcanistLiberateWorkflow.php

index 2fee574f4bd6a5e1570dab7c8d74b841cc148956..b2713c7695eb0d09a8733b0f8d97e99b5e1ee4f1 100644 (file)
@@ -215,10 +215,11 @@ EOTEXT
     echo "Choose a name for the new library.\n";
     do {
       $name = phutil_console_prompt('What do you want to name this library?');
-      if (preg_match('/^[a-z]+$/', $name)) {
+      if (preg_match('/^[a-z-]+$/', $name)) {
         break;
       } else {
-        echo "Library name should contain only lowercase letters.\n";
+        echo "Library name should contain only lowercase letters and ".
+          "hyphens.\n";
       }
     } while (true);