Skip to content

Commit

Permalink
skip julia startup when -v option is requested
Browse files Browse the repository at this point in the history
  • Loading branch information
mlubin committed Apr 14, 2015
1 parent 7aa65b4 commit 965f48e
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 13 deletions.
6 changes: 0 additions & 6 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,6 @@ let reqarg = Set(UTF8String["--home", "-H",
global have_color = (opts.color == 1)
global is_interactive = Bool(opts.isinteractive)
while true
# show julia VERSION and quit
if Bool(opts.version)
println(STDOUT, "julia version ", VERSION)
exit(0)
end

# load ~/.juliarc file
startup && load_juliarc()

Expand Down
1 change: 0 additions & 1 deletion base/options.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# NOTE: This type needs to be kept in sync with jl_options in src/julia.h
immutable JLOptions
version::Int8
quiet::Int8
julia_home::Ptr{Cchar}
julia_bin::Ptr{Cchar}
Expand Down
3 changes: 1 addition & 2 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ DLLEXPORT void gdblookup(ptrint_t ip);

static const char system_image_path[256] = JL_SYSTEM_IMAGE_PATH;

jl_options_t jl_options = { 0, // version
0, // quiet
jl_options_t jl_options = { 0, // quiet
NULL, // julia_home
NULL, // julia_bin
NULL, // build_path
Expand Down
1 change: 0 additions & 1 deletion src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,6 @@ void show_execution_point(char *filename, int lno);
// julia options -----------------------------------------------------------
// NOTE: This struct needs to be kept in sync with JLOptions type in base/options.jl
typedef struct {
int8_t version;
int8_t quiet;
const char *julia_home;
const char *julia_bin;
Expand Down
2 changes: 1 addition & 1 deletion test/cmdlineargs.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
let exename = joinpath(JULIA_HOME, Base.julia_exename())
# --version
let v = split(readall(`$exename -v`), "julia version ")[end]
@test VERSION == VersionNumber(v)
@test Base.VERSION_STRING == chomp(v)
end
@test readall(`$exename -v`) == readall(`$exename --version`)

Expand Down
4 changes: 2 additions & 2 deletions ui/repl.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ void parse_opts(int *argcp, char ***argvp)
lastind = optind;
break;
case 'v': // version
jl_options.version = 1;
break;
jl_printf(JL_STDOUT, "julia version %s\n", JULIA_VERSION_STRING);
jl_exit(0);
case 'h': // help
jl_printf(JL_STDOUT, "%s%s", usage, opts);
jl_exit(0);
Expand Down

0 comments on commit 965f48e

Please sign in to comment.