Skip to content

Manual page generation #2877

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

Merged
merged 6 commits into from
Oct 22, 2015
Merged

Conversation

mmakowski
Copy link
Contributor

Manual page generation from command list defined in Main. Based on the approach and implementation in darcs.

Fixes #848.

@23Skidoo
Copy link
Member

Thanks! Looks good on a first glance.

import Data.Char (toUpper)
import Data.List (intercalate)

data CommandVisibility = Visible | Hidden
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this duplicates the functionality of CommandType in D.S.Command.

@23Skidoo
Copy link
Member

LGTM but I'd like to see some parts moved to D.S.Command.

@23Skidoo
Copy link
Member

A potential future improvement may be to add support for generating per-command manpages (e.g. cabal manpage install). Then we could make cabal help display a manpage when run from the terminal, a-la git help.

@23Skidoo
Copy link
Member

FYI, there are also some formatting problems (but I don't see them as impediment for merging):

formatting_problem

@mmakowski
Copy link
Contributor Author

@23Skidoo, thanks for the review. I will try to address the comments over the next couple of days.

Regarding cabal manpage install, I think that woud require making manpage a library-level special command similar to help. In the existing implementation I tried to confine the manpage concerns to cabal-install. It is still not clear to me which functionality belongs in the library and which in the command-line app, for example I find it surprising that help formatting is a library concern.

Another thing to consider with help displaying manual pages is that man is not availabe on Windows. IIRC git deals with it by making help open a browser pointing to online man page, I'm not sure if that is preferable to showing help in the console.

@23Skidoo
Copy link
Member

Regarding cabal manpage install, I think that woud require making manpage a library-level special command similar to help.

I am not so sure. If you can generate a manpage with information about all commands from cabal-install, it should also be possible to do the same for a single command (maybe after some refactoring of D.S.Command).

Code for help formatting and option handling lives in the Cabal lib because we want to support things like ./Setup foo --help. I think that manpage generation belongs in cabal-install.

Another thing to consider with help displaying manual pages is that man is not availabe on Windows.

In these cases we can just revert to the old mode of output.

@mmakowski
Copy link
Contributor Author

I have now moved command-related bits to D.S.Command and fixed formating of sandbox sub-commands.

@23Skidoo
Copy link
Member

LGTM now.

23Skidoo added a commit that referenced this pull request Oct 22, 2015
@23Skidoo 23Skidoo merged commit 3923101 into haskell:master Oct 22, 2015
@23Skidoo
Copy link
Member

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants