fix the completion problem of man under OS X#960
Closed
wwwjfy wants to merge 2 commits into
fish-shell:masterfish-shell/fish-shell:masterfrom
wwwjfy:osx-man-completion-fixwwwjfy/fish-shell:osx-man-completion-fixCopy head branch name to clipboard
Closed
fix the completion problem of man under OS X#960wwwjfy wants to merge 2 commits intofish-shell:masterfish-shell/fish-shell:masterfrom wwwjfy:osx-man-completion-fixwwwjfy/fish-shell:osx-man-completion-fixCopy head branch name to clipboard
man under OS X#960wwwjfy wants to merge 2 commits into
fish-shell:masterfish-shell/fish-shell:masterfrom
wwwjfy:osx-man-completion-fixwwwjfy/fish-shell:osx-man-completion-fixCopy head branch name to clipboard
Conversation
The problem is `apropos' under OS X behaves differently from Linux. 1. The format: for command `apropos sudo', the output under Linux: ... sudo (8) - execute a command as another user ... and the output under OS X: ... sudo(8) - execute a command as another user ... one-space difference. 2. For some items sharing a same manpage, e.g. for `apropos printf', Linux: ... printf (3) - formatted output conversion snprintf (3) - formatted output conversion sprintf (3) - formatted output conversion vprintf (3) - formatted output conversion vsnprintf (3) - formatted output conversion vsprintf (3) - formatted output conversion ... OS X: ... printf(3), fprintf(3), sprintf(3), snprintf(3), asprintf(3), dprintf(3), vprintf(3), vfprintf(3), vsprintf(3), vsnprintf(3), vasprintf(3), vdprintf(3) - formatted output conversion ... OS X puts them in one line. So, we need special handling here, otherwise, completion with prefix `man 3 printf' will give the result of "man 3 printf\(3\),"
Member
|
The behaviour of |
Contributor
Author
|
@zanchey Oh, I was not aware of that. I don't have FreeBSD, so I don't know how to tell the differences.
|
Member
|
It gets worse! Solaris uses a totally different format altogether! |
Contributor
Author
|
@zanchey So we need another case? I think it'll be difficult to get an all-in-one command |
Member
|
I have a solution using awk, but I'm honestly not sure if we care about Solaris any more. Current fish head doesn't build on Solaris, |
Contributor
Author
|
In my opinion, it's not a problem to improve step by step. If anyone uses Solaris is uncomfortable with it, he can issue a pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem is
aproposunder OS X behaves differently from Linux.apropos sudo, the output under Linux:and the output under OS X:
one-space difference.
apropos printf,Linux:
OS X:
OS X puts them in one line.
So, we need special handling here, otherwise, completion with prefix
man 3 printfwill give the result of "man 3 printf(3),"