-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add: cmdliner.1.1.0 #20667
Add: cmdliner.1.1.0 #20667
Conversation
35750a9
to
9e1c474
Compare
The number of failures is abnormally high. This was supposed to be a mostly compatible release. Let me investigate that. |
Ok I tripped out a little bit too quickly. There's also a lot of stuff that does actually succeed. It seems most errors are due to dbuenzli/cmdliner#124 which was proposed by @talex5. I think it's good to keep @talex5's proposal. A lot of these failures use I propose to let the CI finish and then I will adjust with a first round of constraints – still longing for ocaml/opam#3077 btw :–). |
So I have put a first round of constraints using this technique. |
Is the CI stuck ? Looking at the current state it seems I missed:
Should I simply constraint these and then let you merge it without yet another melting planet CI run ? |
i'll redo the constraints manually in a separate PR later today. |
Not sure I'm getting this. No non-existing |
CI doesn't make the difference between "my dependency failed" and "the package i was trying to build" or even "this package built fine but only the tests failed. |
I see, that's a bit unfortunate. Are there any plans to make the distinction ? I guess it should all start with making
Quoting from memory, in the previous run there were something like 800 failures out of 8000 runs. I doubt that's manageable by hand. Maybe you can simply try to manually inspect the packages that I constrained here (which all did fail because they had |
Can we move on this ? (If there's stuff I can do, tell me) |
9e1c474
to
27423c2
Compare
27423c2
to
6ebaa60
Compare
With #20686 and #20687 all the errors seem to be gone. pinging some of the maintainers affected by the change of API: @NathanReb, @craigfe, @dinosaure, @Leonidas-from-XIV, @gpetiot, @hannesm |
Thanks! |
Thanks @kit-ty-kate for the tremendous help on this. |
Btw. people like @gpetiot are not affected by the API their package tests fails. Please do not test the error or manpage outputs of cmdliner in the |
@kit-ty-kate Ah. Yes. I've stumbled into the exact issue that @talex5 reported so I am kinda happy that this is fixed now because I tripped over it myself just this year. I guess we'll update dune-release and MDX to use cmdliner >= 1.1.0 going forward. |
cmdliner.1.1.0
home, doc, issuesDeclarative definition of command line interfaces for OCaml
cmdliner
v1.1.0 2022-02-06 La Forclaz (VS)Require OCaml 4.08.
Support for deprecating commands, arguments and environment variables (#66).
See the
?deprecated
argument ofCmd.info
,Cmd.Env.info
andArg.info
.Add
Manpage.s_none
a special section name to use whenever youwant something not to be listed in a command's manpage.
Add
Arg.conv'
likeArg.conv
but with a parser signature that returnsuntagged string errors.
Add
Term.{term,cli_parse}_result'
functions.Add deprecation alerts on what is already deprecated.
On unices, use
command -v
rather thantype
to find commands.Stop using backticks for left quotes. Use apostrophes everywhere.
Thanks to Ryan Moore for reporting a typo that prompted the change (#128).
Rework documentation structure. Move out tutorial, examples and
reference doc from the
.mli
to multiple.mld
pages.Arg.doc_alts
andArg.doc_alts_enum
, change the default renderingto match the manpage convention which is to render these tokens in
bold. If you want to recover the previous rendering or were using
these functions outside man page rendering use an explicit
~quoted:true
(the optional argument is available on earlierversions).
The deprecated
Term.exit
andTerm.exit_status_of_result
nowrequire a
unit
result. This avoids various errors to go undetected.Thanks to Thomas Leonard for the patch (#124).
Fix absent and default option values (
?none
string argument ofArg.some
)rendering in manpages:
If you were relying on the third point via
?none
ofArg.some
, use the new?absent
optional argument ofArg.info
instead. Besides a newArg.some'
function is added to specify a value for?none
insteadof a string. Thanks to David Allsopp for the patch (#111).
Documentation generation use:
…
(U+2026) instead of...
forellipsis. See also UTF-8 manpage support below.
Documentation generation, improve command synopsis rendering on
commands with few options (i.e. mention them).
Documentation generation, drop section heading in the output if the section
is empty.
New
Cmd
module and deprecation of theTerm
evaluation interfaceThis version of cmdliner deprecates the
Term.eval*
evaluationfunctions and
Term.info
information values in favor of the newCmdliner.Cmd
module.The
Cmd
module generalizes the existing sub command support to allowarbitrarily nested sub commands each with its own man page and command
line syntax represented by a
Term.t
value.The mapping between the old interface and the new one should be rather
straightforward. In particular
Term.info
andCmd.info
have exactlythe same semantics and fields and a command value simply pairs a
command information with a term.
However in this transition the following things are changed or added:
All default values of
Cmd.info
match those ofTerm.info
exceptfor:
?exits
argument which defaults toCmd.Exit.defaults
rather than the empty list.
?man_xrefs
which defaults to the list[`Main]
ratherthan the empty list (this means that by default sub commands
at any level automatically cross-reference the main command).
?sdocs
argument which defaults toManpage.s_common_options
rather than
Manpage.s_options
.The
Cmd.Exit.some_error
code is added toCmd.Exit.defaults
(which in turn is the default for
Cmd.info
see above). This is anerror code clients can use when they don't want to bother about
having precise exit codes. It is high so that low, meaningful,
codes can later be added without breaking a tool's compatibility. In
particular the convenience evaluation functions
Cmd.eval_result*
use this code when they evaluate to an error.
If you relied on
?term_err
defaulting to1
in the variousTerm.exit*
function, note that the newCmd.eval*
function useExit.cli_error
as a default. You may want to explicitely specify1
instead if you useTerm.ret
with the`Error
caseor
Term.term_result
.Finally be aware that if you replace, in an existing tool, an encoding
of sub commands as positional arguments you will effectively break the
command line compatibility of your tool since options can no longer be
specified before the sub commands, i.e. your tool synopsis moves from:
to
Thanks to Rudi Grinberg for prototyping the feature in #123.
UTF-8 manpage support
It is now possible to write UTF-8 encoded text in your doc strings and
man pages.
The man page renderer used on
--help
defaults tomandoc
ifavailable, then uses
groff
and then defaults tonroff
. Startingwith
mandoc
catches macOS whosegroff
as of 11.6 still doesn'tsupport UTF-8 input and struggles to render some Unicode characters.
The invocations were also tweaked to remove the
-P-c
option whichentails that the default pager
less
is now invoked with the-R
option.If you install UTF-8 encoded man pages output via
--help=groff
, inman
directories bear in mind that these pages will look garbled onstock macOS (at least until 11.6). One way to work around is to
instruct your users to change the
NROFF
definition in/private/etc/man.conf
from:to:
Thanks to Antonin Décimo for his knowledge and helping with these
man
gnificent intricacies (#27).Use
b0 cmd -- .opam.publish cmdliner.1.1.0
to update the pull request.