]> gitweb.factorcode.org Git - factor.git/commitdiff
command-line: cleanup some documentation, change terminology slightly.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 26 Sep 2020 17:52:32 +0000 (10:52 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 26 Sep 2020 17:52:32 +0000 (10:52 -0700)
Refer to "options" instead of "VM args" or "Factor arguments".

basis/command-line/command-line-docs.factor
basis/command-line/command-line.factor
basis/command-line/startup/startup.factor
extra/mason/test/test.factor

index 99c629877ba03ab05bf7414aca01bbb3b54c640b..82ffe45e2b6b08612eaab016a6d3c645c1aed950 100644 (file)
@@ -1,11 +1,11 @@
-USING: help.markup help.syntax strings system vocabs vocabs.loader ;
+USING: help.markup help.syntax io.pathnames strings system vocabs vocabs.loader ;
 IN: command-line
 
 HELP: run-bootstrap-init
-{ $description "Runs the bootstrap initialization file in the user's home directory, unless the " { $snippet "-no-user-init" } " command line switch was given. This file is named " { $snippet ".factor-boot-rc" } "." } ;
+{ $description "Runs the bootstrap initialization file in the user's " { $link home } " directory, unless the " { $snippet "-no-user-init" } " command line switch was given. This file is named " { $snippet ".factor-boot-rc" } "." } ;
 
 HELP: run-user-init
-{ $description "Runs the startup initialization file in the user's home directory, unless the " { $snippet "-no-user-init" } " command line switch was given. This file is named " { $snippet ".factor-rc" } "." } ;
+{ $description "Runs the startup initialization file in the user's " { $link home } " directory, unless the " { $snippet "-no-user-init" } " command line switch was given. This file is named " { $snippet ".factor-rc" } "." } ;
 
 HELP: load-vocab-roots
 { $description "Loads the newline-separated list of additional vocabulary roots from the file named " { $snippet ".factor-roots" } "." } ;
@@ -117,7 +117,7 @@ $nl
 { $subsections load-vocab-roots } ;
 
 ARTICLE: "rc-files" "Running code on startup"
-"Factor looks for three optional files in your home directory."
+"Factor looks for three optional files in the user's " { $link home } " directory."
 { $subsections
     ".factor-boot-rc"
     ".factor-rc"
@@ -125,12 +125,6 @@ ARTICLE: "rc-files" "Running code on startup"
 }
 "The " { $snippet "-no-user-init" } " command line switch will inhibit loading running of these files."
 $nl
-"If you are unsure where the files should be located, evaluate the following code:"
-{ $code
-    "USE: command-line"
-    "\".factor-rc\" rc-path print"
-    "\".factor-boot-rc\" rc-path print"
-}
 "Here is an example " { $snippet ".factor-boot-rc" } " which sets up your developer name:"
 { $code
     "USING: tools.scaffold namespaces ;"
@@ -139,8 +133,8 @@ $nl
 
 ARTICLE: "command-line" "Command line arguments"
 "Factor command line usage:"
-{ $code "factor [VM args...] [script] [args...]" }
-"Zero or more VM arguments can be passed in, followed by an optional script file name. If the script file is specified, it will be run on startup using " { $link run-script } ". Any arguments after the script file are stored in the following variable, with no further processing by Factor itself:"
+{ $code "factor [options] [script] [arguments]" }
+"Zero or more options can be passed in, followed by an optional script file name. If the script file is specified, it will be run on startup using " { $link run-script } ". Any arguments after the script file are stored in the following variable, with no further processing by Factor itself:"
 { $subsections command-line }
 "Instead of running a script, it is also possible to run a vocabulary; this invokes the vocabulary's " { $link POSTPONE: MAIN: } " word:"
 { $code "factor [system switches...] -run=<vocab name>" }
index aeb26c8e5e29336faf73b7389e4d468c4d734aff..39217ce61dd1683a47b5b372ca1f2077f4b50aa7 100644 (file)
@@ -24,9 +24,6 @@ SYMBOL: command-line
 : (command-line) ( -- args )
     OBJ-ARGS special-object sift [ alien>native-string ] map ;
 
-: rc-path ( name -- path )
-    home prepend-path ;
-
 : try-user-init ( file -- )
     "user-init" get swap '[
         _ [ ?run-file ] [
@@ -37,14 +34,14 @@ SYMBOL: command-line
     ] when ;
 
 : run-bootstrap-init ( -- )
-    ".factor-boot-rc" rc-path try-user-init ;
+    "~/.factor-boot-rc" try-user-init ;
 
 : run-user-init ( -- )
-    ".factor-rc" rc-path try-user-init ;
+    "~/.factor-rc" try-user-init ;
 
 : load-vocab-roots ( -- )
     "user-init" get [
-        ".factor-roots" rc-path dup exists? [
+        "~/.factor-roots" dup exists? [
             utf8 file-lines harvest [ add-vocab-root ] each
         ] [ drop ] if
         "roots" get [
index cb005283a6458af8cd34ae1f9894aae72ed5727c..55ea43fbf7a04993848290bf79762f59f459a7ee 100644 (file)
@@ -9,9 +9,9 @@ IN: command-line.startup
     os windows? [ script get "/?" = or ] when ;
 
 : help. ( -- )
-"Usage: " write vm-path file-name write " [Factor arguments] [script] [script arguments]
+"Usage: " write vm-path file-name write " [options] [script] [arguments]
 
-Factor arguments:
+Options:
     -help               print this message and exit
     -version            print the Factor version and exit
     -i=<image>          load Factor image file <image> [" write vm-path file-stem write ".image]
@@ -32,12 +32,11 @@ Factor arguments:
     -fep                enter fep mode immediately
     -no-signals         turn off OS signal handling
     -console            open console if possible
-    -roots=<paths>      a list of \"" write os windows? ";" ":" ? write "\"-delimited extra vocab roots
+    -roots=<paths>      '" write os windows? ";" ":" ? write "'-separated list of extra vocab root directories
 
 Enter
     \"command-line\" help
 from within Factor for more information.
-
 " write ;
 
 : version? ( -- ? ) "version" get ;
index 43b2ccf5582e4f86a5d0dc54ddf0de1cc87e7dec..ea79090eefa19e205e43b1be4f2483963939d11d 100644 (file)
@@ -100,7 +100,7 @@ M: method word-vocabulary "method-generic" word-prop word-vocabulary ;
 
 : run-mason-rc ( -- )
     t "user-init" [
-        ".factor-mason-rc" rc-path try-user-init
+        "~/.factor-mason-rc" try-user-init
     ] with-variable ;
 
 : check-user-init-errors ( -- ? )