Skip to content

Commit

Permalink
Make library-opam list subcommand output with lines
Browse files Browse the repository at this point in the history
Subcommand `library-opam list` originally output a list of packages with a OCaml
list format like `["dist"; "fss"]`.

This commit makes the output shellscript friendly--one line for each package
name-- like this:

```
dist
fss
```
  • Loading branch information
na4zagin3 committed Apr 10, 2022
1 parent 563f30b commit b0a500b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/commandLibrary.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ let library_opam_list () =
Compatibility.optin ();
let env = Setup.read_environment () in
Option.iter env.opam_reg ~f:(fun opam_reg ->
[%derive.show: string list] (OpamSatysfiRegistry.list opam_reg) |> print_endline
)
OpamSatysfiRegistry.list opam_reg
|> List.sort ~compare:String.compare
|> String.concat ~sep:"\n"
|> print_endline
)
let library_opam_list_command =
library_list_command_g library_opam_list

Expand Down

0 comments on commit b0a500b

Please sign in to comment.