File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -79,13 +79,18 @@ function _print_usage(io::IO=stdout)
7979 println (io, " --compile-ccallable Export ccallable entrypoints" )
8080 println (io, " --experimental Forwarded to Julia (needed for --trim)" )
8181 println (io, " --verbose Print commands and timings" )
82+ println (io, " --version Print juliac and julia version" )
8283 println (io, " -h, --help Show this help" )
8384 println (io)
8485 println (io, " Examples:" )
8586 println (io, " juliac --output-exe app ./MyApp.jl --bundle build --trim=safe" )
8687 println (io, " juliac --output-lib build/libmylib --project ./MyLib.jl src/libentry.jl" )
8788end
8889
90+ function _print_version (io:: IO = stdout )
91+ println (io, " juliac version $(pkgversion (JuliaC)) , julia version $(VERSION ) " )
92+ end
93+
8994# CLI app entrypoint for Pkg apps
9095function _parse_cli_args (args:: Vector{String} )
9196 image_recipe = ImageRecipe ()
@@ -166,6 +171,9 @@ function _main_cli(args::Vector{String}; io::IO=stdout)
166171 if isempty (args) || any (a -> a == " -h" || a == " --help" , args)
167172 _print_usage (io)
168173 return
174+ elseif " --version" in args
175+ _print_version (io)
176+ return
169177 end
170178 img, link, bun = _parse_cli_args (args)
171179 compile_products (img)
Original file line number Diff line number Diff line change 137137 @test occursin (" --verbose" , out)
138138 @test occursin (" --help" , out)
139139end
140+
141+ @testset " CLI --version" begin
142+ io = IOBuffer ()
143+ JuliaC. _main_cli (String[" --version" ]; io = io)
144+ @test String (take! (io)) ==
145+ " juliac version $(pkgversion (JuliaC)) , julia version $(VERSION ) \n "
146+ end
You can’t perform that action at this time.
0 commit comments