Skip to content

Commit 96cc970

Browse files
committed
Merge pull request #11420 from JuliaLang/jb/interactiveoption
make -i option run REPL. fixes #11347
2 parents 3bc6c75 + 5b9fd0b commit 96cc970

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

NEWS.md

+6
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ Language changes
114114
macro. Instead, the string is first unindented and then `x_str` is invoked,
115115
as if the string had been single-quoted ([#10228]).
116116

117+
Command line option changes
118+
---------------------------
119+
120+
* The `-i` option now forces the REPL to run after loading the specified script (if any) ([#11347]).
121+
117122
Compiler improvements
118123
---------------------
119124

@@ -1426,4 +1431,5 @@ Too numerous to mention.
14261431
[#11145]: https://github.com/JuliaLang/julia/issues/11145
14271432
[#11171]: https://github.com/JuliaLang/julia/issues/11171
14281433
[#11241]: https://github.com/JuliaLang/julia/issues/11241
1434+
[#11347]: https://github.com/JuliaLang/julia/issues/11347
14291435
[#11379]: https://github.com/JuliaLang/julia/issues/11379

base/client.jl

+4-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ let reqarg = Set(UTF8String["--home", "-H",
306306
repl = false
307307
# remove filename from ARGS
308308
shift!(ARGS)
309-
ccall(:jl_exit_on_sigint, Void, (Cint,), 1)
309+
if !is_interactive
310+
ccall(:jl_exit_on_sigint, Void, (Cint,), 1)
311+
end
310312
include(args[1])
311313
else
312314
println(STDERR, "julia: unknown option `$(args[1])`")
@@ -315,6 +317,7 @@ let reqarg = Set(UTF8String["--home", "-H",
315317
end
316318
break
317319
end
320+
repl |= is_interactive
318321
return (quiet,repl,startup,color_set,history_file)
319322
end
320323
end

ui/repl.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static const char opts[] =
6161
" 'auto' launches as many workers as the number of local cores\n"
6262
" --machinefile <file> Run processes on hosts listed in <file>\n\n"
6363

64-
" -i Force isinteractive() to be true\n"
64+
" -i Interactive mode; REPL runs and isinteractive() is true\n"
6565
" --color={yes|no} Enable or disable color text\n\n"
6666
" --history-file={yes|no} Load or save history\n"
6767
" --no-history-file Don't load history file (deprecated, use --history-file=no)\n"
@@ -76,8 +76,7 @@ static const char opts[] =
7676

7777
" --track-allocation={none|user|all}, --track-allocation\n"
7878
" Count bytes allocated by each source line\n\n"
79-
" -O, --optimize\n"
80-
" Run time-intensive code optimizations\n"
79+
" -O, --optimize Run time-intensive code optimizations\n"
8180
" --check-bounds={yes|no} Emit bounds checks always or never (ignoring declarations)\n"
8281
" --dump-bitcode={yes|no} Dump bitcode for the system image (used with --build)\n"
8382
" --depwarn={yes|no} Enable or disable syntax and method deprecation warnings\n"

0 commit comments

Comments
 (0)