Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create an alias from pkg to package #10858

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Leonidas-from-XIV marked this conversation as resolved.
Show resolved Hide resolved
]
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
Loading