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

Introduce command line options --norepl and --nointeract, remove IsLIBGAP constant #2723

Merged
merged 2 commits into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions lib/init.g
Original file line number Diff line number Diff line change
Expand Up @@ -938,16 +938,6 @@ BindGlobal ("ShowSystemInformation", function ()
end );


#############################################################################
##
## Initialize the IsLIBGAP variable (if not done before). If this variable
## is false, an interactive session will be started.
## Otherwise no interactive session is started.
##
if not IsBound( IsLIBGAP ) then
BIND_CONSTANT( "IsLIBGAP", false );
fi;

#############################################################################
##
## Finally, deal with the lists of global variables.
Expand Down Expand Up @@ -1037,8 +1027,9 @@ InstallAndCallPostRestore( function()
od;
end );

if IsLIBGAP then
# GAP is used as a library, do not start an interactive session

if GAPInfo.CommandLineOptions.norepl then
# do not start an interactive session
elif IsHPCGAP and THREAD_UI() then
ReadLib("hpc/consoleui.g");
MULTI_SESSION();
Expand Down
13 changes: 12 additions & 1 deletion lib/system.g
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ BIND_GLOBAL( "GAPInfo", rec(
help := [ "Run ProfileLineByLine(<filename>) with recordMem := true on GAP start"] ),
rec( long := "cover", default := "", arg := "<file>",
help := [ "Run CoverageLineByLine(<filename>) on GAP start"] ),
rec( long := "enableMemCheck", default := false)
rec( long := "enableMemCheck", default := false),
rec( long := "norepl", default := false,
help := [ "Disable the GAP read-evaluate-print loop (REPL)" ] ),
rec( long := "nointeract", default := false,
help := [ "Start GAP in non-interactive mode (disable read-evaluate-print loop (REPL) and break loop)" ] )
],
) );

Expand Down Expand Up @@ -377,6 +381,13 @@ CallAndInstallPostRestore( function()
CommandLineOptions.g:= CommandLineOptions.g mod 3;
# use the same as the kernel
CommandLineOptions.E:= GAPInfo.KernelInfo.HAVE_LIBREADLINE;

# --nointeract implies no break loop and no repl
if CommandLineOptions.nointeract then
CommandLineOptions.T := true;
CommandLineOptions.norepl := true;
fi;

MakeImmutable( CommandLineOptions );
MakeImmutable( InitFiles );

Expand Down
11 changes: 0 additions & 11 deletions tst/testinstall/IsLIBGAP.tst

This file was deleted.