diff --git a/doc/make.jl b/doc/make.jl index 972da3d7e3891..4c1ccaa3a6e73 100644 --- a/doc/make.jl +++ b/doc/make.jl @@ -100,7 +100,7 @@ Manual = [ "manual/faq.md", "manual/noteworthy-differences.md", "manual/unicode-input.md", - "manual/command-line-options.md", + "manual/command-line-interface.md", ] BaseDocs = [ diff --git a/doc/src/manual/command-line-options.md b/doc/src/manual/command-line-interface.md similarity index 96% rename from doc/src/manual/command-line-options.md rename to doc/src/manual/command-line-interface.md index 3839e503ab4bb..1c281a67e55e9 100644 --- a/doc/src/manual/command-line-options.md +++ b/doc/src/manual/command-line-interface.md @@ -1,4 +1,4 @@ -# [Command-line Options](@id command-line-options) +# Command-line Interface ## Using arguments inside scripts @@ -39,6 +39,9 @@ $ julia --color=yes -O -- script.jl arg1 arg2.. See also [Scripting](@ref man-scripting) for more information on writing Julia scripts. + +## Parallel mode + Julia can be started in parallel mode with either the `-p` or the `--machine-file` options. `-p n` will launch an additional `n` worker processes, while `--machine-file file` will launch a worker for each line in file `file`. The machines defined in `file` must be accessible via a password-less @@ -48,6 +51,9 @@ takes the form `[count*][user@]host[:port] [bind_addr[:port]]`. `user` defaults to 1. The optional `bind-to bind_addr[:port]` specifies the IP address and port that other workers should use to connect to this worker. + +## Startup file + If you have code that you want executed whenever Julia is run, you can put it in `~/.julia/config/startup.jl`: @@ -63,7 +69,17 @@ Note that although you should have a `~/.julia` directory once you've run Julia first time, you may need to create the `~/.julia/config` folder and the `~/.julia/config/startup.jl` file if you use it. -## Command-line switches for Julia +To have startup code run only in [The Julia REPL] (and not when `julia` is *e.g.* run +on a script), use [`atreplinit`](@ref) in `startup.jl`: + +```julia +atreplinit() do repl + # ... +end +``` + + +## [Command-line switches for Julia](@id command-line-options) There are various ways to run Julia code and provide options, similar to those available for the `perl` and `ruby` programs: diff --git a/doc/src/manual/getting-started.md b/doc/src/manual/getting-started.md index a3a92c6d7c93c..16dab24afecf9 100644 --- a/doc/src/manual/getting-started.md +++ b/doc/src/manual/getting-started.md @@ -34,8 +34,7 @@ command: $ julia script.jl ``` -You can pass additional arguments to Julia, and to your program `script.jl`. A detailed list of all the available switches can be found at [Command-line Options](@ref -command-line-options). +You can pass additional arguments to Julia, and to your program `script.jl`. A detailed list of all the available options can be found under [Command-line Interface](@ref). ## Resources