Skip to content

Commit

Permalink
Add io argument to banner
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Jan 11, 2014
1 parent c5e4bd8 commit 78f95e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/version.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ catch e
global const VERSION = VersionNumber(0)
end

function banner()
function banner(io::IO = STDOUT)
if BUILD_INFO.tagged_commit
commit_string = BUILD_INFO.TAGGED_RELEASE_BANNER
elseif BUILD_INFO.commit == ""
Expand All @@ -212,7 +212,7 @@ function banner()
d3 = "\033[32m" # third dot
d4 = "\033[35m" # fourth dot

print("""\033[1m $(d3)_
print(io,"""\033[1m $(d3)_
$(d1)_ $(jl)_$(tx) $(d2)_$(d3)(_)$(d4)_$(tx) | A fresh approach to technical computing
$(d1)(_)$(jl) | $(d2)(_)$(tx) $(d4)(_)$(tx) | Documentation: http://docs.julialang.org
$(jl)_ _ _| |_ __ _$(tx) | Type \"help()\" to list help topics
Expand All @@ -223,7 +223,7 @@ function banner()
\033[0m""")
else
print("""
print(io,"""
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
Expand Down

7 comments on commit 78f95e0

@ivarne
Copy link
Member

@ivarne ivarne commented on 78f95e0 Jan 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @loladiro, I did not see this. Why not make the color argument explicit in the same way?

@ViralBShah this should fix Keno/REPL.jl#11 (comment)

@Keno
Copy link
Member Author

@Keno Keno commented on 78f95e0 Jan 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not a bad idea.

@StefanKarpinski
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More radical idea is to support some basic markup in message strings, including color, which is ignored on output if the terminal is configured not to support color.

@ivarne
Copy link
Member

@ivarne ivarne commented on 78f95e0 Jan 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that we would get a terminal_color_str macro where one can insert color codes that will be removed if we do not use colors?

@StefanKarpinski
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea would be for it to be more generic than just for terminals. Think HTML, etc.

@ivarne
Copy link
Member

@ivarne ivarne commented on 78f95e0 Jan 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the requested markdown features for inline documentation? Does markdown support manually coloring text in this way, or would we need to implement our own extension?

@StefanKarpinski
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. I think I this would be orthogonal to any particular syntax.

Please sign in to comment.