- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Replace --quiet with --banner #23343
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
Changes from 8 commits
6713d86
ab11f26
097ea08
fbbe19a
88c0dbe
5c692d4
9615340
46389d2
d1a64f5
1a10f16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,7 +253,7 @@ function process_options(opts::JLOptions) | |
repl = true | ||
startup = (opts.startupfile != 2) | ||
history_file = (opts.historyfile != 0) | ||
quiet = (opts.quiet != 0) | ||
banner = (opts.banner != 0) | ||
color_set = (opts.color != 0) | ||
global have_color = (opts.color == 1) | ||
global is_interactive = (opts.isinteractive != 0) | ||
|
@@ -317,7 +317,7 @@ function process_options(opts::JLOptions) | |
break | ||
end | ||
repl |= is_interactive | ||
return (quiet,repl,startup,color_set,history_file) | ||
return (banner,repl,startup,color_set,history_file) | ||
end | ||
|
||
function load_juliarc() | ||
|
@@ -380,7 +380,7 @@ function _start() | |
opts = JLOptions() | ||
@eval Main include(x) = $include(Main, x) | ||
try | ||
(quiet,repl,startup,color_set,history_file) = process_options(opts) | ||
(banner,repl,startup,color_set,history_file) = process_options(opts) | ||
|
||
local term | ||
global active_repl | ||
|
@@ -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)) | ||
quiet || REPL.banner(term,term) | ||
banner && REPL.banner(term,term) | ||
if term.term_type == "dumb" | ||
active_repl = REPL.BasicREPL(term) | ||
quiet || warn("Terminal not fully functional") | ||
banner && warn("Terminal not fully functional") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit strange to depend on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, but I would argue that's beyond the scope of this PR. It's just that the better option name made it clear how weird it is that this works this way, so that's a good sign for this change. I've opened a separate issue about this: #23380. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
else | ||
active_repl = REPL.LineEditREPL(term, true) | ||
active_repl.history_file = history_file | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ JL_DLLEXPORT const char *jl_get_default_sysimg_path(void) | |
} | ||
|
||
|
||
jl_options_t jl_options = { 0, // quiet | ||
jl_options_t jl_options = { 1, // banner | ||
NULL, // julia_home | ||
NULL, // julia_bin | ||
NULL, // eval | ||
|
@@ -102,7 +102,7 @@ static const char opts[] = | |
|
||
// interactive options | ||
" -i Interactive mode; REPL runs and isinteractive() is true\n" | ||
" -q, --quiet Quiet startup (no banner)\n" | ||
" --banner={yes|no} Enable or disable startup banner\n" | ||
" --color={yes|no} Enable or disable color text\n" | ||
" --history-file={yes|no} Load or save history\n\n" | ||
|
||
|
@@ -170,7 +170,8 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp) | |
opt_output_ji, | ||
opt_use_precompiled, | ||
opt_use_compilecache, | ||
opt_incremental | ||
opt_incremental, | ||
opt_banner | ||
}; | ||
static const char* const shortopts = "+vhqH:e:E:L:J:C:ip:O:g:"; | ||
static const struct option longopts[] = { | ||
|
@@ -180,6 +181,7 @@ 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' }, | ||
|
@@ -280,9 +282,6 @@ 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")) | ||
|
@@ -315,6 +314,18 @@ 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"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should add a comment in the 0.7 section of base/deprecated.jl so this gets staged for removal at the right time also should add a NEWS.md note about the changed command-line flag |
||
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; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in the 0.7 section instead of 0.6, around line 320 in this file :)