Allow picking arbitrary cowfiles

Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
This commit is contained in:
Thomas A. Christensen II 2021-11-23 11:35:20 -06:00
parent 82c6cab321
commit b8758352c0
Signed by: millironx
GPG key ID: 139C07724802BC5D

View file

@ -3,13 +3,17 @@ module Cowsay
export cowsay export cowsay
include("cows/default.cow.jl") include("cows/default.cow.jl")
include("cows/udder.cow.jl")
include("cows/vader-koala.cow.jl")
include("cows/vader.cow.jl")
include("cows/www.cow.jl")
""" """
cowsay(message::AbstractString) cowsay(message::AbstractString)
Prints a cow saying `message` as unwrapped text. Prints a cow saying `message` as unwrapped text.
""" """
function cowsay(message::AbstractString; eyes="oo", tongue=" ") function cowsay(message::AbstractString; cow=default, eyes="oo", tongue=" ")
messagelines = split(message, "\n") messagelines = split(message, "\n")
nlines = length(messagelines) nlines = length(messagelines)
@ -54,7 +58,7 @@ function cowsay(message::AbstractString; eyes="oo", tongue=" ")
) )
end end
println(string(balloon, default(eyes=eyes, tongue=tongue))) println(string(balloon, cow(eyes=eyes, tongue=tongue)))
end end