Stay in -i REPL after ERROR?

first-steps
repl

#1

I am debugging my first Julia script with the -i flag.
After an Error, the interactive REPL exits.
Is there a way to remain in the repl to examine the variables, definitions, etc. that caused the error?
Thank you!


#2

from a julia REPL call include("my_script.jl").


#3

Thank you!
My scripts usually have command line arguments. I suppose I could split the scripts in two parts (one to parse the arguments, one to include).


#4

I am not sure how to handle command line arguments with include, but command line arguments get saved in a variable called ARGS, you could just set it yourself.

E.g. try running this from your shell:

julia -e "@show ARGS" input1 input2

you can set ARGS from inside julia simply by

ARGS = String["input1", "input2"]

#5

Thank you.
That does not solve my problem with running scripts with -i though.
Should I open an issue on Github?


#6

no Idea what the intended behavior o the -i option is, someone else has to answer this.


#7

Exactly, you can just do

ARGS = split("hello world 3 4 5")
include("my_script_that_parses_ARGS.jl")

and it will behave as if you did

> julia my_script_that_parses_ARGS.jl hello world 3 4 5

from the command line.