Skip to content

Commit b0a500b

Browse files
committed
Make library-opam list subcommand output with lines
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 ```
1 parent 563f30b commit b0a500b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bin/commandLibrary.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ let library_opam_list () =
3030
Compatibility.optin ();
3131
let env = Setup.read_environment () in
3232
Option.iter env.opam_reg ~f:(fun opam_reg ->
33-
[%derive.show: string list] (OpamSatysfiRegistry.list opam_reg) |> print_endline
34-
)
33+
OpamSatysfiRegistry.list opam_reg
34+
|> List.sort ~compare:String.compare
35+
|> String.concat ~sep:"\n"
36+
|> print_endline
37+
)
3538
let library_opam_list_command =
3639
library_list_command_g library_opam_list
3740

0 commit comments

Comments
 (0)