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

Fix opam switch list-available when given several arguments #6318

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ users)

## Switch
* [BUG] Fix `opam switch remove <dir>` failure when it is a linked switch [#6276 @btjorge - fix #6275]
* Fix `opam switch list-available` when given several arguments [#6318 @kit-ty-kate]
kit-ty-kate marked this conversation as resolved.
Show resolved Hide resolved

## Config

Expand Down
4 changes: 2 additions & 2 deletions src/client/opamCommands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2904,7 +2904,7 @@ let switch cli =
in
let all_compilers =
OpamListCommand.filter ~base:compilers st
(OpamFormula.ands (List.map (fun f -> OpamFormula.Atom f) filters))
(OpamFormula.ors (List.map (fun f -> OpamFormula.Atom f) filters))
in
let compilers =
if all then
Expand Down Expand Up @@ -3199,7 +3199,7 @@ let pin_doc = "Pin a given package to a specific version or source."
let pin ?(unpin_only=false) cli =
let doc = pin_doc in
let commands = [
cli_original, "list", `list, [],
cli_original, "list", `list, [],
"Lists pinned packages. \
If the source is a remote repository, \
displays the hash representing its state.";
Expand Down
12 changes: 12 additions & 0 deletions tests/reftests/switch-list-available.test
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,15 @@ comp_c 1
# Name # Version # Synopsis
comp_c 1
comp_c 2
### : show the behaviour of list-available with several arguments
### opam switch list-available "comp-*" "comp_*"
# Listing available compilers from repositories: default
# Name # Version # Synopsis
comp-a 1
comp-b 1
comp_c 1
comp-a 2
comp-a 3
comp-a 4
comp-b 4
[NOTE] Some compilers have been hidden (e.g. pre-releases). If you want to display them, run: 'opam switch list-available --all'