Skip to content

Commit

Permalink
feature: create dune show command group
Browse files Browse the repository at this point in the history
This is an alias of dune describe.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
  • Loading branch information
Alizter authored and rgrinberg committed Jun 13, 2023
1 parent 158f31d commit cf0423d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
19 changes: 12 additions & 7 deletions bin/describe/describe.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ open Import
- duniverse people for "describe opam-files" *)

let subcommands =
[ Describe_workspace.command
; Describe_external_lib_deps.command
; Describe_opam_files.command
; Describe_pp.command
]

let make_group info =
let default = Describe_workspace.term in
Cmd.group ~default info subcommands

let group =
let doc = "Describe the workspace." in
let man =
Expand All @@ -26,10 +37,4 @@ let group =
]
in
let info = Cmd.info "describe" ~doc ~man in
let default = Describe_workspace.term in
Cmd.group ~default info
[ Describe_workspace.command
; Describe_external_lib_deps.command
; Describe_opam_files.command
; Describe_pp.command
]
make_group info
3 changes: 3 additions & 0 deletions bin/describe/describe.mli
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
open Import

val make_group : Cmd.info -> unit Cmd.t

(** Command group for dune describe *)
val group : unit Cmd.t
1 change: 1 addition & 0 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ let all : _ Cmdliner.Cmd.t list =
[ Ocaml_cmd.group
; Coq.group
; Describe.group
; Show.group
; Rpc.group
; Internal.group
; Init.group
Expand Down
6 changes: 6 additions & 0 deletions bin/show.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
open Import

let group =
let doc = "Command group for showing information about the workspace" in
let info = Cmd.info ~doc "show" in
Describe.make_group info
4 changes: 4 additions & 0 deletions bin/show.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
open Import

(** Command group for dune show (alias of describe) *)
val group : unit Cmd.t

0 comments on commit cf0423d

Please sign in to comment.