]> gitweb.factorcode.org Git - factor.git/commitdiff
help.lint: changing command-line to add --only and do load/help-lint each.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 22 Nov 2020 04:29:54 +0000 (20:29 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 22 Nov 2020 04:29:54 +0000 (20:29 -0800)
basis/help/lint/lint.factor

index ddf3c775f1783e68fbda53905fcbc6a014228bde..79037578290372b2ce49364106a38c7056ff2e76 100644 (file)
@@ -70,7 +70,7 @@ PRIVATE>
     <vocab-link> dup
     '[ _ vocab-help [ lookup-article drop ] when* ] check-something ;
 
-: check-vocab ( vocab -- )
+: help-lint-vocab ( vocab -- )
     "Checking " write dup write "..." print flush
     [ check-about ]
     [ vocab-words [ check-word ] each ]
@@ -84,7 +84,7 @@ PRIVATE>
         auto-use? off
         group-articles vocab-articles set
         loaded-child-vocab-names
-        [ check-vocab ] each
+        [ help-lint-vocab ] each
     ] with-scope ;
 
 : help-lint-all ( -- ) "" help-lint ;
@@ -101,8 +101,11 @@ PRIVATE>
     [ predicate? ] reject ;
 
 : test-lint-main ( -- )
-    command-line get [ load ] each
-    help-lint-all
+    command-line get dup first "--only" = [
+        rest [ [ require ] [ help-lint-vocab ] bi ] each
+    ] [
+        [ [ load ] [ help-lint ] bi ] each
+    ] if
     lint-failures get assoc-empty?
     [ [ "==== FAILING LINT" print :lint-failures flush ] unless ]
     [ 0 1 ? exit ] bi ;