command-line: cleanup some documentation, change terminology slightly.
Refer to "options" instead of "VM args" or "Factor arguments".master
parent
5a71d98d29
commit
7bd1adb1c3
|
@ -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
|
IN: command-line
|
||||||
|
|
||||||
HELP: run-bootstrap-init
|
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
|
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
|
HELP: load-vocab-roots
|
||||||
{ $description "Loads the newline-separated list of additional vocabulary roots from the file named " { $snippet ".factor-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 } ;
|
{ $subsections load-vocab-roots } ;
|
||||||
|
|
||||||
ARTICLE: "rc-files" "Running code on startup"
|
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
|
{ $subsections
|
||||||
".factor-boot-rc"
|
".factor-boot-rc"
|
||||||
".factor-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."
|
"The " { $snippet "-no-user-init" } " command line switch will inhibit loading running of these files."
|
||||||
$nl
|
$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:"
|
"Here is an example " { $snippet ".factor-boot-rc" } " which sets up your developer name:"
|
||||||
{ $code
|
{ $code
|
||||||
"USING: tools.scaffold namespaces ;"
|
"USING: tools.scaffold namespaces ;"
|
||||||
|
@ -139,8 +133,8 @@ $nl
|
||||||
|
|
||||||
ARTICLE: "command-line" "Command line arguments"
|
ARTICLE: "command-line" "Command line arguments"
|
||||||
"Factor command line usage:"
|
"Factor command line usage:"
|
||||||
{ $code "factor [VM args...] [script] [args...]" }
|
{ $code "factor [options] [script] [arguments]" }
|
||||||
"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:"
|
"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 }
|
{ $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:"
|
"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>" }
|
{ $code "factor [system switches...] -run=<vocab name>" }
|
||||||
|
|
|
@ -24,9 +24,6 @@ SYMBOL: command-line
|
||||||
: (command-line) ( -- args )
|
: (command-line) ( -- args )
|
||||||
OBJ-ARGS special-object sift [ alien>native-string ] map ;
|
OBJ-ARGS special-object sift [ alien>native-string ] map ;
|
||||||
|
|
||||||
: rc-path ( name -- path )
|
|
||||||
home prepend-path ;
|
|
||||||
|
|
||||||
: try-user-init ( file -- )
|
: try-user-init ( file -- )
|
||||||
"user-init" get swap '[
|
"user-init" get swap '[
|
||||||
_ [ ?run-file ] [
|
_ [ ?run-file ] [
|
||||||
|
@ -37,14 +34,14 @@ SYMBOL: command-line
|
||||||
] when ;
|
] when ;
|
||||||
|
|
||||||
: run-bootstrap-init ( -- )
|
: run-bootstrap-init ( -- )
|
||||||
".factor-boot-rc" rc-path try-user-init ;
|
"~/.factor-boot-rc" try-user-init ;
|
||||||
|
|
||||||
: run-user-init ( -- )
|
: run-user-init ( -- )
|
||||||
".factor-rc" rc-path try-user-init ;
|
"~/.factor-rc" try-user-init ;
|
||||||
|
|
||||||
: load-vocab-roots ( -- )
|
: load-vocab-roots ( -- )
|
||||||
"user-init" get [
|
"user-init" get [
|
||||||
".factor-roots" rc-path dup exists? [
|
"~/.factor-roots" dup exists? [
|
||||||
utf8 file-lines harvest [ add-vocab-root ] each
|
utf8 file-lines harvest [ add-vocab-root ] each
|
||||||
] [ drop ] if
|
] [ drop ] if
|
||||||
"roots" get [
|
"roots" get [
|
||||||
|
|
|
@ -9,9 +9,9 @@ IN: command-line.startup
|
||||||
os windows? [ script get "/?" = or ] when ;
|
os windows? [ script get "/?" = or ] when ;
|
||||||
|
|
||||||
: help. ( -- )
|
: 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
|
-help print this message and exit
|
||||||
-version print the Factor version and exit
|
-version print the Factor version and exit
|
||||||
-i=<image> load Factor image file <image> [" write vm-path file-stem write ".image]
|
-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
|
-fep enter fep mode immediately
|
||||||
-no-signals turn off OS signal handling
|
-no-signals turn off OS signal handling
|
||||||
-console open console if possible
|
-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
|
Enter
|
||||||
\"command-line\" help
|
\"command-line\" help
|
||||||
from within Factor for more information.
|
from within Factor for more information.
|
||||||
|
|
||||||
" write ;
|
" write ;
|
||||||
|
|
||||||
: version? ( -- ? ) "version" get ;
|
: version? ( -- ? ) "version" get ;
|
||||||
|
|
|
@ -100,7 +100,7 @@ M: method word-vocabulary "method-generic" word-prop word-vocabulary ;
|
||||||
|
|
||||||
: run-mason-rc ( -- )
|
: run-mason-rc ( -- )
|
||||||
t "user-init" [
|
t "user-init" [
|
||||||
".factor-mason-rc" rc-path try-user-init
|
"~/.factor-mason-rc" try-user-init
|
||||||
] with-variable ;
|
] with-variable ;
|
||||||
|
|
||||||
: check-user-init-errors ( -- ? )
|
: check-user-init-errors ( -- ? )
|
||||||
|
|
Loading…
Reference in New Issue