Skip to content

Commit

Permalink
ADDED: swipl pack list --dir=DIR option to list packs installed i…
Browse files Browse the repository at this point in the history
…n DIR.
  • Loading branch information
JanWielemaker committed Dec 21, 2024
1 parent f1bd567 commit 8261b0f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions app/pack.pl
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,18 @@
pack_remove:opt_help(interactive, "Use default answers (non-interactive)").
pack_remove:opt_help(dependencies, "Remove dependencies as well?").

pack_list:opt_type(installed, installed, boolean).
pack_list:opt_type(i, installed, boolean).
pack_list:opt_type(outdated, outdated, boolean).
pack_list:opt_type(server, server, (boolean|atom)).
pack_list:opt_type(installed, installed, boolean).
pack_list:opt_type(i, installed, boolean).
pack_list:opt_type(outdated, outdated, boolean).
pack_list:opt_type(server, server, (boolean|atom)).
pack_list:opt_type(dir, pack_directory, directory).

pack_list:opt_meta(server, 'URL|false').

pack_list:opt_help(installed, "Only list installed packages").
pack_list:opt_help(outdated, "Only list packages that can be upgraded").
pack_list:opt_help(server, "Use as `--no-server` or `server=URL`").
pack_list:opt_help(installed, "Only list installed packages").
pack_list:opt_help(outdated, "Only list packages that can be upgraded").
pack_list:opt_help(server, "Use as `--no-server` or `server=URL`").
pack_list:opt_help(pack_directory, "Directory for --installed").

pack_install:opt_type(url, url, atom).
pack_install:opt_type(dir, pack_directory, directory(write)).
Expand Down Expand Up @@ -214,6 +216,10 @@
pack_publish:opt_meta(branch, 'BRANCH').
pack_publish:opt_meta(server, 'URL').

cli_pack_list(Pos, Options),
select_option(pack_directory(Dir), Options, Options1) =>
attach_packs(Dir, [replace(true)]),
cli_pack_list(Pos, [installed(true)|Options1]).
cli_pack_list([], Options) =>
pack_list('', [installed(true)|Options]).
cli_pack_list([Search], Options) =>
Expand Down

0 comments on commit 8261b0f

Please sign in to comment.