From 5838b47c22edaa998447fb08be86478cd12168fd Mon Sep 17 00:00:00 2001 From: Ali Caglayan Date: Mon, 12 Jun 2023 16:30:13 +0200 Subject: [PATCH] create dune show command group This is an alias of dune describe. Signed-off-by: Ali Caglayan --- CHANGES.md | 3 +++ bin/describe/describe.ml | 20 ++++++++++++++------ bin/describe/describe.mli | 6 ++++++ bin/main.ml | 1 + 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 79d46e9eec5..b2a0919c8ef 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,9 @@ Unreleased ---------- +- Add `dune show` command group which is an alias of `dune describe`. (#7946, + @Alizter) + - Fix printing errors from excerpts whenever character offsets span multiple lines (#7950, fixes #7905, @rgrinberg) diff --git a/bin/describe/describe.ml b/bin/describe/describe.ml index 7f8c2f04e01..1d36ed73310 100644 --- a/bin/describe/describe.ml +++ b/bin/describe/describe.ml @@ -7,6 +7,13 @@ 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 group = let doc = "Describe the workspace." in let man = @@ -27,9 +34,10 @@ 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 - ] + Cmd.group ~default info subcommands + +module Show = struct + let group = + let doc = "Command group for showing information about the workspace" in + Cmd.group (Cmd.info ~doc "show") subcommands +end diff --git a/bin/describe/describe.mli b/bin/describe/describe.mli index d4c5902fcd6..3627ce93cd0 100644 --- a/bin/describe/describe.mli +++ b/bin/describe/describe.mli @@ -1,3 +1,9 @@ open Import +(** Command group for dune describe *) val group : unit Cmd.t + +module Show : sig + (** Command group for dune show (alias of describe) *) + val group : unit Cmd.t +end diff --git a/bin/main.ml b/bin/main.ml index 7475c9d330b..26997c15d98 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -32,6 +32,7 @@ let all : _ Cmdliner.Cmd.t list = [ Ocaml_cmd.group ; Coq.group ; Describe.group + ; Describe.Show.group ; Rpc.group ; Internal.group ; Init.group