Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Replace --quiet with --banner (#23343)" #23396

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,6 @@ Command-line option changes
* New option `--warn-overwrite={yes|no}` to control the warning for overwriting method
definitions. The default is `no` ([#23002]).

* The `-q` and `--quiet` flags have been deprecated in favor of `--banner={yes|no}` ([#23342]).

Julia v0.6.0 Release Notes
==========================

Expand Down Expand Up @@ -1196,4 +1194,3 @@ Command-line option changes
[#23157]: https://github.com/JuliaLang/julia/issues/23157
[#23187]: https://github.com/JuliaLang/julia/issues/23187
[#23207]: https://github.com/JuliaLang/julia/issues/23207
[#23342]: https://github.com/JuliaLang/julia/issues/23342
10 changes: 5 additions & 5 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function process_options(opts::JLOptions)
repl = true
startup = (opts.startupfile != 2)
history_file = (opts.historyfile != 0)
banner = (opts.banner != 0)
quiet = (opts.quiet != 0)
color_set = (opts.color != 0)
global have_color = (opts.color == 1)
global is_interactive = (opts.isinteractive != 0)
Expand Down Expand Up @@ -317,7 +317,7 @@ function process_options(opts::JLOptions)
break
end
repl |= is_interactive
return (banner,repl,startup,color_set,history_file)
return (quiet,repl,startup,color_set,history_file)
end

function load_juliarc()
Expand Down Expand Up @@ -380,7 +380,7 @@ function _start()
opts = JLOptions()
@eval Main include(x) = $include(Main, x)
try
(banner,repl,startup,color_set,history_file) = process_options(opts)
(quiet,repl,startup,color_set,history_file) = process_options(opts)

local term
global active_repl
Expand All @@ -393,10 +393,10 @@ function _start()
term = Terminals.TTYTerminal(get(ENV, "TERM", @static Sys.iswindows() ? "" : "dumb"), STDIN, STDOUT, STDERR)
global is_interactive = true
color_set || (global have_color = Terminals.hascolor(term))
banner && REPL.banner(term,term)
quiet || REPL.banner(term,term)
if term.term_type == "dumb"
active_repl = REPL.BasicREPL(term)
banner && warn("Terminal not fully functional")
quiet || warn("Terminal not fully functional")
else
active_repl = REPL.LineEditREPL(term, true)
active_repl.history_file = history_file
Expand Down
3 changes: 0 additions & 3 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1707,9 +1707,6 @@ export hex2num
# issue #5148, PR #23259
# warning for `const` on locals should be changed to an error in julia-syntax.scm

# issue #23342, PR #23343
# `-q` and `--quiet` are deprecated in jloptions.c

# issue #17886
# deprecations for filter[!] with 2-arg functions are in associative.jl

Expand Down
2 changes: 1 addition & 1 deletion base/options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# NOTE: This type needs to be kept in sync with jl_options in src/julia.h
struct JLOptions
banner::Int8
quiet::Int8
julia_home::Ptr{UInt8}
julia_bin::Ptr{UInt8}
eval::Ptr{UInt8}
Expand Down
4 changes: 2 additions & 2 deletions doc/man/julia.1
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ Run processes on hosts listed in <file>
Interactive mode; REPL runs and isinteractive() is true

.TP
--banner={yes|no}
Enable or disable startup banner
-q, --quiet
Quiet startup without banner

.TP
--color={yes|no}
Expand Down
2 changes: 1 addition & 1 deletion doc/src/manual/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ julia [switches] -- [programfile] [args...]
--machinefile <file> Run processes on hosts listed in <file>

-i Interactive mode; REPL runs and isinteractive() is true
--banner={yes|no} Enable or disable startup banner
-q, --quiet Quiet startup (no banner)
--color={yes|no} Enable or disable color text
--history-file={yes|no} Load or save history

Expand Down
23 changes: 6 additions & 17 deletions src/jloptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ JL_DLLEXPORT const char *jl_get_default_sysimg_path(void)
}


jl_options_t jl_options = { 1, // banner
jl_options_t jl_options = { 0, // quiet
NULL, // julia_home
NULL, // julia_bin
NULL, // eval
Expand Down Expand Up @@ -102,7 +102,7 @@ static const char opts[] =

// interactive options
" -i Interactive mode; REPL runs and isinteractive() is true\n"
" --banner={yes|no} Enable or disable startup banner\n"
" -q, --quiet Quiet startup\n"
" --color={yes|no} Enable or disable color text\n"
" --history-file={yes|no} Load or save history\n\n"

Expand Down Expand Up @@ -170,8 +170,7 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
opt_output_ji,
opt_use_precompiled,
opt_use_compilecache,
opt_incremental,
opt_banner
opt_incremental
};
static const char* const shortopts = "+vhqH:e:E:L:J:C:ip:O:g:";
static const struct option longopts[] = {
Expand All @@ -181,7 +180,6 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
{ "version", no_argument, 0, 'v' },
{ "help", no_argument, 0, 'h' },
{ "quiet", no_argument, 0, 'q' },
{ "banner", required_argument, 0, opt_banner },
{ "home", required_argument, 0, 'H' },
{ "eval", required_argument, 0, 'e' },
{ "print", required_argument, 0, 'E' },
Expand Down Expand Up @@ -282,6 +280,9 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
case 'h': // help
jl_printf(JL_STDOUT, "%s%s", usage, opts);
jl_exit(0);
case 'q': // quiet
jl_options.quiet = 1;
break;
case 'g': // debug info
if (optarg != NULL) {
if (!strcmp(optarg,"0"))
Expand Down Expand Up @@ -314,18 +315,6 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
jl_options.image_file = strdup(optarg);
jl_options.image_file_specified = 1;
break;
case 'q': // quiet
jl_printf(JL_STDERR, "-q and --quiet are deprecated, use --banner=no instead\n");
jl_options.banner = 0;
break;
case opt_banner: // banner
if (!strcmp(optarg,"yes"))
jl_options.banner = 1;
else if (!strcmp(optarg,"no"))
jl_options.banner = 0;
else
jl_errorf("julia: invalid argument to --banner={yes|no} (%s)", optarg);
break;
case opt_use_precompiled:
if (!strcmp(optarg,"yes"))
jl_options.use_precompiled = JL_OPTIONS_USE_PRECOMPILED_YES;
Expand Down
2 changes: 1 addition & 1 deletion src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ JL_DLLEXPORT void jl_(void *jl_value);
// julia options -----------------------------------------------------------
// NOTE: This struct needs to be kept in sync with JLOptions type in base/options.jl
typedef struct {
int8_t banner;
int8_t quiet;
const char *julia_home;
const char *julia_bin;
const char *eval;
Expand Down
4 changes: 2 additions & 2 deletions test/cmdlineargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let exename = `$(Base.julia_cmd()) --precompiled=yes --startup-file=no`
@test startswith(read(`$exename --help`, String), header)
end

# --banner
# --quiet
# This flag is indirectly tested in test/repl.jl

# --home
Expand Down Expand Up @@ -72,7 +72,7 @@ let exename = `$(Base.julia_cmd()) --precompiled=yes --startup-file=no`
end

# --procs
@test readchomp(`$exename --banner=no -p 2 -e "println(nworkers())"`) == "2"
@test readchomp(`$exename -q -p 2 -e "println(nworkers())"`) == "2"
@test !success(`$exename -p 0`)
@test !success(`$exename --procs=1.0`)

Expand Down
4 changes: 2 additions & 2 deletions test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ let exename = Base.julia_cmd()
TestHelpers.with_fake_pty() do slave, master
nENV = copy(ENV)
nENV["TERM"] = "dumb"
p = spawn(setenv(`$exename --startup-file=no --banner=no`,nENV),slave,slave,slave)
p = spawn(setenv(`$exename --startup-file=no --quiet`,nENV),slave,slave,slave)
output = readuntil(master,"julia> ")
if ccall(:jl_running_on_valgrind,Cint,()) == 0
# If --trace-children=yes is passed to valgrind, we will get a
Expand All @@ -631,7 +631,7 @@ let exename = Base.julia_cmd()
end

# Test stream mode
outs, ins, p = readandwrite(`$exename --startup-file=no --banner=no`)
outs, ins, p = readandwrite(`$exename --startup-file=no --quiet`)
write(ins,"1\nquit()\n")
@test read(outs, String) == "1\n"
end # let exename
Expand Down