Skip to content

Commit

Permalink
Fix opam switch list-available when given several arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Nov 30, 2024
1 parent c1cd790 commit b7a41d1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
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]

## 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
10 changes: 9 additions & 1 deletion tests/reftests/switch-list-available.test
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,12 @@ comp_c 2
### : show the behaviour of list-available with several arguments
### opam switch list-available "comp-*" "comp_*"
# Listing available compilers from repositories: default
# No matches found
# 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'

0 comments on commit b7a41d1

Please sign in to comment.