open Cmdliner open Cmdliner.Term.Syntax module Command_dequeue = Merge_queue_eio.Command_dequeue let action out : Common.action Term.t = let+ out and+ name = let doc = "The branch to withdraw." in Arg.(required & pos 0 (some Common.branch) None & info [] ~docv:"NAME" ~doc) in fun ctx -> match Command_dequeue.run ctx name with | Ended r -> Common.result out r | Left signal -> Merge_queue.Signal.exit_code signal let cmd = let man = [ `S Manpage.s_description; `P "Withdraw $(i,NAME) from every queue. The branch, its commits and its \ worktree stay, and a waiting $(b,mq land) ends with $(b,removed). A \ $(i,NAME) that is not queued exits 0 and says so; an unknown \ $(i,NAME) is refused."; ] in Common.v "dequeue" ~exits:Act ~doc:"Withdraw a branch from the queue." ~man action