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

Make --quiet and --banner independent (fix #23380) #23399

Merged
merged 1 commit into from
Aug 25, 2017
Merged

Conversation

StefanKarpinski
Copy link
Sponsor Member

@StefanKarpinski StefanKarpinski commented Aug 22, 2017

This allows --banner={yes,no} to be set independently from --quiet, which, without an explicit --banner flag implies --banner=no. Adds tests for both options and their interaction.

@yuyichao
Copy link
Contributor

I'm fine with either way but I'm not really convinced that we really need the --banner=* option that does basically the same thing as -q 99% of the time.......

@StefanKarpinski
Copy link
Sponsor Member Author

You may be right. Now we have both options available to merge.

@JeffBezanson
Copy link
Sponsor Member

I think a good option is to remove the terminal warning; then these two command-line options collapse to one.

@yuyichao
Copy link
Contributor

remove the terminal warning

What's the likelihood that we'll have other REPL initialization warnnings? In any case though, since this is basically a REPL only option so the easiness to type in a terminal matters more (compare to other options) and so I would prefer an option with a shortform. -q naturally fill in that role thought sth like -bn can also work, if not a little bit strange....

@HarrisonGrodin
Copy link
Contributor

HarrisonGrodin commented Aug 22, 2017

This strategy seems logical, also remaining consistent with other languages. For example, IPython uses very similar flags, although their --no-banner is not inferred by --quiet. (I am in favor of that inference, as is included in this PR.)

--no-banner
    Don't display a banner upon starting IPython.
--quiet
    set log level to logging.CRITICAL (minimize logging output)

If logging is added into Base (JuliaLang/Juleps#30), the --quiet flag could become something similar to an alias for --logging=error, using the assumption that the banner is of level info or debug.

@ViralBShah
Copy link
Member

ViralBShah commented Aug 22, 2017

Having -bn be a short form for --banner=no would be useful, as I often use -q myself. As @HarrisonGrodin says, freeing up -q and --quiet for future usage could be valuable too.

@StefanKarpinski
Copy link
Sponsor Member Author

Two-letter short options are a non-starter. With this PR, you can use -q to suppress the banner (and the one rare REPL warning). If --quiet is used in the future to suppress more than that, we could consider adding an abbreviation for turning the REPL off. I'm going to move on from this issue and someone else can decide which of the two perfectly viable directions we should go here.

@ViralBShah
Copy link
Member

ViralBShah commented Aug 22, 2017

Since this does make -q work and keeps the --banner options, seems perfectly fine to merge this to me. For log levels, we can always use --logging= in full form, if that ever happens.

@JeffBezanson
Copy link
Sponsor Member

Ok, I'm fine with this. I buy the -q == "no banner plus log level" argument.

@tkelman tkelman added the needs news A NEWS entry is required for this change label Aug 23, 2017
@StefanKarpinski StefanKarpinski removed the needs news A NEWS entry is required for this change label Aug 24, 2017
@StefanKarpinski StefanKarpinski merged commit 03660a4 into master Aug 25, 2017
@StefanKarpinski StefanKarpinski deleted the sk/quieter branch August 25, 2017 16:43
@ararslan
Copy link
Member

Unless I'm missing something, did this PR make banner suppression the default?

[13:03:09] alex:julia git:(master) $ ./julia
julia> 

:/

@StefanKarpinski
Copy link
Sponsor Member Author

Oops. That was not the intention. Will fix.

@ararslan
Copy link
Member

This might fix it:

diff --git a/base/client.jl b/base/client.jl
index 3f2f434bf9..b3600669d8 100644
--- a/base/client.jl
+++ b/base/client.jl
@@ -394,7 +394,7 @@ 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)
+                (banner || is_interactive) && REPL.banner(term,term)
                 if term.term_type == "dumb"
                     active_repl = REPL.BasicREPL(term)
                     quiet || warn("Terminal not fully functional")

@StefanKarpinski
Copy link
Sponsor Member Author

Yeah, that probably works too.

@ararslan
Copy link
Member

I think what you have in your PR is more correct. Thanks for jumping on that!

@StefanKarpinski
Copy link
Sponsor Member Author

StefanKarpinski commented Aug 26, 2017

Well, I did break it after all. We can't have the banner not printing. There has always been a banner.

StefanKarpinski added a commit that referenced this pull request Aug 26, 2017
fix PR #23399 accidentally turning off banner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants