Skip to content

Commit 33f5042

Browse files
committed
Revert "Replace --quiet with --banner (#23343)"
This reverts commit dcb46b3 , 92f70e2 and clarify the help message of `--quiet`. The option added in the two commits makes zero sense and is simply a duplication of existing one for all practical purposes. There has be no justification for why the option needs to be added.
1 parent 9b3b2ff commit 33f5042

File tree

9 files changed

+16
-48
lines changed

9 files changed

+16
-48
lines changed

NEWS.md

-5
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,6 @@ Command-line option changes
374374
* New option `--warn-overwrite={yes|no}` to control the warning for overwriting method
375375
definitions. The default is `no` ([#23002]).
376376

377-
* New option `--banner={yes,no}` allows suppressing or forcing the printing of the
378-
startup banner, overriding the default behavior (banner in REPL, no banner otherwise).
379-
The `--quiet` option implies `--banner=no` even in REPL mode but can be overridden by
380-
passing `--quiet` together with `--banner=yes` ([#23342]).
381-
382377
Julia v0.6.0 Release Notes
383378
==========================
384379

base/client.jl

+4-5
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,9 @@ function process_options(opts::JLOptions)
251251
length(idxs) > 0 && deleteat!(ARGS, idxs[1])
252252
end
253253
repl = true
254-
quiet = (opts.quiet != 0)
255-
banner = (opts.banner == 1 || opts.banner != 0 && opts.isinteractive != 0)
256254
startup = (opts.startupfile != 2)
257255
history_file = (opts.historyfile != 0)
256+
quiet = (opts.quiet != 0)
258257
color_set = (opts.color != 0)
259258
global have_color = (opts.color == 1)
260259
global is_interactive = (opts.isinteractive != 0)
@@ -318,7 +317,7 @@ function process_options(opts::JLOptions)
318317
break
319318
end
320319
repl |= is_interactive
321-
return (quiet,banner,repl,startup,color_set,history_file)
320+
return (quiet,repl,startup,color_set,history_file)
322321
end
323322

324323
function load_juliarc()
@@ -381,7 +380,7 @@ function _start()
381380
opts = JLOptions()
382381
@eval Main include(x) = $include(Main, x)
383382
try
384-
(quiet,banner,repl,startup,color_set,history_file) = process_options(opts)
383+
(quiet,repl,startup,color_set,history_file) = process_options(opts)
385384

386385
local term
387386
global active_repl
@@ -394,7 +393,7 @@ function _start()
394393
term = Terminals.TTYTerminal(get(ENV, "TERM", @static Sys.iswindows() ? "" : "dumb"), STDIN, STDOUT, STDERR)
395394
global is_interactive = true
396395
color_set || (global have_color = Terminals.hascolor(term))
397-
banner && REPL.banner(term,term)
396+
quiet || REPL.banner(term,term)
398397
if term.term_type == "dumb"
399398
active_repl = REPL.BasicREPL(term)
400399
quiet || warn("Terminal not fully functional")

base/options.jl

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# NOTE: This type needs to be kept in sync with jl_options in src/julia.h
44
struct JLOptions
55
quiet::Int8
6-
banner::Int8
76
julia_home::Ptr{UInt8}
87
julia_bin::Ptr{UInt8}
98
eval::Ptr{UInt8}

doc/man/julia.1

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ Run processes on hosts listed in <file>
108108
Interactive mode; REPL runs and isinteractive() is true
109109

110110
.TP
111-
--banner={yes|no}
112-
Enable or disable startup banner
111+
-q, --quiet
112+
Quiet startup without banner
113113

114114
.TP
115115
--color={yes|no}

doc/src/manual/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ julia [switches] -- [programfile] [args...]
114114
--machinefile <file> Run processes on hosts listed in <file>
115115
116116
-i Interactive mode; REPL runs and isinteractive() is true
117-
--banner={yes|no} Enable or disable startup banner
117+
-q, --quiet Quiet startup (no banner)
118118
--color={yes|no} Enable or disable color text
119119
--history-file={yes|no} Load or save history
120120

src/jloptions.c

+5-19
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ JL_DLLEXPORT const char *jl_get_default_sysimg_path(void)
3434

3535

3636
jl_options_t jl_options = { 0, // quiet
37-
-1, // banner
3837
NULL, // julia_home
3938
NULL, // julia_bin
4039
NULL, // eval
@@ -103,8 +102,7 @@ static const char opts[] =
103102

104103
// interactive options
105104
" -i Interactive mode; REPL runs and isinteractive() is true\n"
106-
" -q, --quiet Quiet startup: no banner, suppress REPL warnings\n"
107-
" --banner={yes|no} Enable or disable startup banner\n"
105+
" -q, --quiet Quiet startup\n"
108106
" --color={yes|no} Enable or disable color text\n"
109107
" --history-file={yes|no} Load or save history\n\n"
110108

@@ -172,8 +170,7 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
172170
opt_output_ji,
173171
opt_use_precompiled,
174172
opt_use_compilecache,
175-
opt_incremental,
176-
opt_banner
173+
opt_incremental
177174
};
178175
static const char* const shortopts = "+vhqH:e:E:L:J:C:ip:O:g:";
179176
static const struct option longopts[] = {
@@ -183,7 +180,6 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
183180
{ "version", no_argument, 0, 'v' },
184181
{ "help", no_argument, 0, 'h' },
185182
{ "quiet", no_argument, 0, 'q' },
186-
{ "banner", required_argument, 0, opt_banner },
187183
{ "home", required_argument, 0, 'H' },
188184
{ "eval", required_argument, 0, 'e' },
189185
{ "print", required_argument, 0, 'E' },
@@ -284,6 +280,9 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
284280
case 'h': // help
285281
jl_printf(JL_STDOUT, "%s%s", usage, opts);
286282
jl_exit(0);
283+
case 'q': // quiet
284+
jl_options.quiet = 1;
285+
break;
287286
case 'g': // debug info
288287
if (optarg != NULL) {
289288
if (!strcmp(optarg,"0"))
@@ -316,19 +315,6 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
316315
jl_options.image_file = strdup(optarg);
317316
jl_options.image_file_specified = 1;
318317
break;
319-
case 'q': // quiet
320-
jl_options.quiet = 1;
321-
if (jl_options.banner < 0)
322-
jl_options.banner = 0;
323-
break;
324-
case opt_banner: // banner
325-
if (!strcmp(optarg,"yes"))
326-
jl_options.banner = 1;
327-
else if (!strcmp(optarg,"no"))
328-
jl_options.banner = 0;
329-
else
330-
jl_errorf("julia: invalid argument to --banner={yes|no} (%s)", optarg);
331-
break;
332318
case opt_use_precompiled:
333319
if (!strcmp(optarg,"yes"))
334320
jl_options.use_precompiled = JL_OPTIONS_USE_PRECOMPILED_YES;

src/julia.h

-1
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,6 @@ JL_DLLEXPORT void jl_(void *jl_value);
16721672
// NOTE: This struct needs to be kept in sync with JLOptions type in base/options.jl
16731673
typedef struct {
16741674
int8_t quiet;
1675-
int8_t banner;
16761675
const char *julia_home;
16771676
const char *julia_bin;
16781677
const char *eval;

test/cmdlineargs.jl

+2-12
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,8 @@ let exename = `$(Base.julia_cmd()) --precompiled=yes --startup-file=no`
2222
@test startswith(read(`$exename --help`, String), header)
2323
end
2424

25-
# --quiet, --banner
26-
let t(q,b) = "Base.JLOptions().quiet == $q && Base.JLOptions().banner == $b"
27-
@test success(`$exename -e $(t(0, -1))`)
28-
@test success(`$exename -q -e $(t(1, 0))`)
29-
@test success(`$exename --quiet -e $(t(1, 0))`)
30-
@test success(`$exename --banner=no -e $(t(0, 0))`)
31-
@test success(`$exename --banner=yes -e $(t(0, 1))`)
32-
@test success(`$exename -q --banner=no -e $(t(1, 0))`)
33-
@test success(`$exename -q --banner=yes -e $(t(1, 1))`)
34-
@test success(`$exename --banner=no -q -e $(t(1, 0))`)
35-
@test success(`$exename --banner=yes -q -e $(t(1, 1))`)
36-
end
25+
# --quiet
26+
# This flag is indirectly tested in test/repl.jl
3727

3828
# --home
3929
@test success(`$exename -H $JULIA_HOME`)

test/repl.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ let exename = Base.julia_cmd()
626626
TestHelpers.with_fake_pty() do slave, master
627627
nENV = copy(ENV)
628628
nENV["TERM"] = "dumb"
629-
p = spawn(setenv(`$exename --startup-file=no -q`,nENV),slave,slave,slave)
629+
p = spawn(setenv(`$exename --startup-file=no --quiet`,nENV),slave,slave,slave)
630630
output = readuntil(master,"julia> ")
631631
if ccall(:jl_running_on_valgrind,Cint,()) == 0
632632
# If --trace-children=yes is passed to valgrind, we will get a
@@ -643,7 +643,7 @@ let exename = Base.julia_cmd()
643643
end
644644

645645
# Test stream mode
646-
outs, ins, p = readandwrite(`$exename --startup-file=no -q`)
646+
outs, ins, p = readandwrite(`$exename --startup-file=no --quiet`)
647647
write(ins,"1\nquit()\n")
648648
@test read(outs, String) == "1\n"
649649
end # let exename

0 commit comments

Comments
 (0)