Skip to content

Commit

Permalink
Add cmd line arg
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Dec 18, 2024
1 parent 99e7acb commit e473f8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/package.gi
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ end );
## In earlier versions, this function had an argument; now we ignore it.
##
InstallGlobalFunction( InitializePackagesInfoRecords, function( arg )
local pkgdirs, pkgdir, ignore, name, files, record, r;
local pkgdirs, pkgdir, pkgdirstrs, ignore, name, files, record, r;

if IsBound( GAPInfo.PackagesInfoInitialized ) and
GAPInfo.PackagesInfoInitialized = true then
Expand All @@ -301,6 +301,13 @@ InstallGlobalFunction( InitializePackagesInfoRecords, function( arg )
LogPackageLoadingMessage( PACKAGE_DEBUG,
"entering InitializePackagesInfoRecords", "GAP" );

# the first time this is called, add the cmd line args to the list
if IsEmpty(GAPInfo.PackageDirectories) then
for pkgdirstrs in GAPInfo.CommandLineOptions.packagedirs do
pkgdirs:= List( SplitString( pkgdirstrs, ";" ), Directory);
APPEND_LIST_INTR( GAPInfo.PackageDirectories, pkgdirs );

Check warning on line 308 in lib/package.gi

View check run for this annotation

Codecov / codecov/patch

lib/package.gi#L307-L308

Added lines #L307 - L308 were not covered by tests
od;
fi;
# add any new pkg directories to the list
pkgdirs:= DirectoriesLibrary( "pkg" );
if pkgdirs <> fail then
Expand Down
3 changes: 3 additions & 0 deletions lib/system.g
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ BIND_GLOBAL( "GAPInfo", rec(
"directories to the end/start of existing list",
"of root paths" ] ),
rec( short:= "r", default := false, help := ["disable/enable user GAP root dir", "GAPInfo.UserGapRoot"] ),
rec( long := "packagedirs", default := [], arg := "<paths>",
help := [ "set or modify the GAP directory paths",
"Directories are separated using ';'." ] ),
,
rec( section:= ["Loading:"] ),
rec( short:= "A", default := false, help := ["disable/enable autoloading of suggested", "GAP packages"] ),
Expand Down

0 comments on commit e473f8e

Please sign in to comment.