Skip to content

Commit

Permalink
feat: create an alias from pkg to package (#10858)
Browse files Browse the repository at this point in the history
* feat: create an alias from pkg to package

Signed-off-by: Etienne Marais <dev@maiste.fr>
  • Loading branch information
maiste authored Sep 5, 2024
1 parent 9c0d65b commit 77592f5
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
1 change: 1 addition & 0 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ let all : _ Cmdliner.Cmd.t list =
; Init.group
; Promotion.group
; Pkg.group
; Pkg.Alias.group
]
in
terms @ groups
Expand Down
35 changes: 18 additions & 17 deletions bin/pkg/pkg.ml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
open Import

let info =
let doc = "Experimental package management" in
let man =
[ `S "DESCRIPTION"
; `P {|Commands for doing package management with dune|}
; `Blocks Common.help_secs
]
in
Cmd.info "pkg" ~doc ~man
let man =
[ `S "DESCRIPTION"
; `P {|Commands for OCaml package management|}
; `Blocks Common.help_secs
]
;;

let subcommands =
[ Lock.command; Print_solver_env.command; Outdated.command; Validate_lock_dir.command ]
;;

let group =
Cmd.group
info
[ Lock.command
; Print_solver_env.command
; Outdated.command
; Validate_lock_dir.command
]
let info name =
let doc = "Experimental package management" in
Cmd.info name ~doc ~man
;;

let group = Cmd.group (info "pkg") subcommands

module Alias = struct
let group = Cmd.group (info "package") subcommands
end
4 changes: 4 additions & 0 deletions bin/pkg/pkg.mli
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
open Import

val group : unit Cmd.t

module Alias : sig
val group : unit Cmd.t
end
9 changes: 9 additions & 0 deletions doc/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,15 @@
(package dune)
(files dune-ocaml-merlin.1))

(rule
(with-stdout-to dune-package.1
(run dune package --help=groff)))

(install
(section man)
(package dune)
(files dune-package.1))

(rule
(with-stdout-to dune-pkg.1
(run dune pkg --help=groff)))
Expand Down

0 comments on commit 77592f5

Please sign in to comment.