Is there a way to determine if a julia script myprog.jl has been invoked from the command line via julia myprog.jl or from the REPL via include("myprog.jl")?
Background: I'm using the ArgParse.jl package and since I cannot pass command line arguments from the REPL, I want to just set a variable ARGS = "argA --optB 1 --flagC" prior to calling include("myprog.jl") in order to achieve the same result as julia myprog.jl argA --optB 1 --flagC from the command line. To do this I need to know if the program was called from the command line or from the REPL, such that I could just write something like
if called_from_repl
parse_args(split(ARGS),s)
else
parse_args(s)
end