Julia access command line options

When i type

$ julia -p 2 run.jl 

is there any way to access 2 from inside run.jl ? I know that you can use ARGS to access arguments, for example

 #run.jl println(ARGS[2]) 

and working

 $ julia -p 2 run.jl abcd 

will return b . But I can not find a way to access the parameters -p <n> .

+5
source share
1 answer

In 0.4+, you can access the parameters being analyzed using Base.JLOptions() , so your -p argument will be here:

 Base.JLOptions().nprocs 
+3
source

All Articles