-
Notifications
You must be signed in to change notification settings - Fork 701
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
cabal man
does not work on macOS
#7714
Comments
Something that might be more portable is piping into
(That looks horrible. But even the HTML rendering is horrible.) However, the output of
Quick fix is to drop the piping into Then folks can choose their OS-specific rendering of their taste. |
Is there any way to make |
What about using nroff instead of groff as in https://unix.stackexchange.com/a/313110 ? |
Here is man's man page for BSD: https://www.freebsd.org/cgi/man.cgi?query=man @fgaz wrote:
Thanks indeed, this works, yet without formatting. However, this is of limited use because:
It seems like every option is repeated for each command. The text is highly redundant:
So, it is inflated by a factor of >30. What is actually the purpose of Is it used to automatically produce man-pages for some distro? @gbaz wrote:
Thanks, this actually produces nice formatting.
It still suffers from the redundancy problem, though. |
WIP: This does not work yet, I need some help with constructing the pipe correctly in Haskell.
See #7714: I am trying to implement a pipe in Haskell to the effect of
but for some reason it does not do what I would expect. Help wanted! |
We have to keep in mind that nroff/groff could be absent too! For example in NixOS:
Should the command depend on the platform? Furthermore, |
I think this is a lot of hoops to jump through for a rarely used command that doesn't seem particularly important for most purposes? I'm in favor of doing a basic fix to it, but unless we already have infrastructure in place to lookup a pager etc, probably overkill. |
Oh for sure, I just meant that the fix shouldn't be at the expense of other users, like in linux, where I wasn't actually proposing to check for edit: well ok, nroff is actually a dependency of man, it's just that NixOS doesn't expose dependencies by default, which isn't what the majority does. So I guess this affects less platforms than I thought, and only the $PAGER regression remains, which is minor compared to making the command work on all platforms |
The output of
|
Directly piping into `man -l -` does not work as BSD-`man` does not understand option `-l`. More standardized are the building blocks `nroff` and `less`. `cabal man` now should behave as pipeline ``` cabal man --raw | nroff -man /dev/stdin | less ``` Also fixed output of `cabal man --raw` so that it does not produce warnings. - `.R` removed. Was warning: ``` `R' is a string (producing the registered sign), not a macro. ``` - No quoted 'new-FOO' should appear at beginning of line. Was warning: ``` warning: macro `new-FOO'' not defined (probably missing space after `ne') ``` Added to `cabal-testsuite/PackageTests/Man/cabal.test.hs` a check that the `stderr` output of `nroff -man /dev/stdin` is empty (no warnings). Remaining problem: Unfortunately, after quitting `less` with `q` the following error is displayed: ``` fd:NNN: commitBuffer: resource vanished (Broken pipe) ``` Not sure how to fix this (my attempts failed).
…Windows Windows does not have `nroff` (neither has it `man`) and `cabal man` fails there usually for lack of these backends.
apparently, this also happens on BSD |
Directly piping into `man -l -` does not work as BSD-`man` does not understand option `-l`. More standardized are the building blocks `nroff` and `less`. `cabal man` now should behave as pipeline ``` cabal man --raw | nroff -man /dev/stdin | less ``` Also fixed output of `cabal man --raw` so that it does not produce warnings. - `.R` removed. Was warning: ``` `R' is a string (producing the registered sign), not a macro. ``` - No quoted 'new-FOO' should appear at beginning of line. Was warning: ``` warning: macro `new-FOO'' not defined (probably missing space after `ne') ``` Added to `cabal-testsuite/PackageTests/Man/cabal.test.hs` a check that the `stderr` output of `nroff -man /dev/stdin` is empty (no warnings). Remaining problem: Unfortunately, after quitting `less` with `q` the following error is displayed: ``` fd:NNN: commitBuffer: resource vanished (Broken pipe) ``` Not sure how to fix this (my attempts failed).
…Windows Windows does not have `nroff` (neither has it `man`) and `cabal man` fails there usually for lack of these backends.
Fix #7714: use nroff -man | less as backend for cabal man
Re #6548:
cabal man
does not work on macOSAlso, there is a typo in an error message:
The text was updated successfully, but these errors were encountered: