]> gitweb.factorcode.org Git - factor.git/commitdiff
Allow specifying vocabulary roots on the command line
authorBenjamin Pollack <benjamin@bitquabit.com>
Thu, 3 Mar 2016 19:24:54 +0000 (14:24 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 4 Mar 2016 18:51:21 +0000 (10:51 -0800)
Fixes #1498

README.md
basis/command-line/command-line-tests.factor
basis/command-line/command-line.factor
basis/command-line/startup/startup.factor

index bcc4e434b2a27058ecf01334d2d4282be3fc30f1..1abecf2bca5a0543c0a8ff8dc4ec0ce7ad3da09e 100644 (file)
--- a/README.md
+++ b/README.md
@@ -98,6 +98,7 @@ Common arguments:
         -run=ui.tools    run Factor development UI
     -e=<code>        evaluate <code>
     -no-user-init    suppress loading of .factor-rc
+    -roots=<paths>   a list of path-delimited extra vocab roots
 
 Enter
     "command-line" help
index 36943a2a58e1c3f98af0de8dc16dad50b1cb2401..4652c1d066d347f8fb6d73d34d46aed328668c5b 100644 (file)
@@ -30,3 +30,7 @@ IN: command-line
     { "factor" "-foo" "a" "b" "c" } parse-command-line
     executable get script get command-line get
 ] unit-test
+
+{ "a:b:c" } [ { "factor" "-roots=a:b:c" } parse-command-line
+    "roots" get-global
+] unit-test
index 44ff0c0c1206fe7417858b2095c5c03ad6cdf33a..9d4ccda7f3b92a9f418fec94a38a1e8e0f932673 100644 (file)
@@ -48,6 +48,10 @@ SYMBOL: command-line
         ".factor-roots" rc-path dup exists? [
             utf8 file-lines harvest [ add-vocab-root ] each
         ] [ drop ] if
+        "roots" get [
+            os windows? ";" ":" ?
+            split [ add-vocab-root ] each
+        ] when*
     ] when ;
 
 : var-param ( name value -- ) swap set-global ;
index f3df3d7f1aa5fecf95965f27426a220c3f74bce2..726a369a9c236ed754477aa076765f13909bbf90 100644 (file)
@@ -27,6 +27,7 @@ Common arguments:
     -fep                enter fep mode immediately
     -nosignals          turn off OS signal handling
     -console            open console if possible
+    -roots=<paths>      a list of \"" write os windows? ";" ":" ? write "\"-delimited extra vocab roots
 
 Enter
     \"command-line\" help