在我的 linux 系统上,我可以执行“man git log”(注意空格),这将按预期显示 git-log(1) 的联机帮助页(带有破折号)。
在我的 MacOSX 机器上,“man git log”只显示 git(1) 的手册页。
linux 人怎么知道应该结合“git”和“log”这两个参数来找到“git-log”联机帮助页?我如何在 OSX 中获得相同的结果?
最佳答案
这是 particular implementation of man
的一个特征在许多 Linux 系统上使用。引用documentation (对于man
),在--no-subpages
选项的描述中提到:
--no-subpages
By default,
man
will try to interpret pairs of manual page names given on the command line as equivalent to a single manual page name containing a hyphen or an underscore. This supports the common pattern of programs that implement a number of subcommands, allowing them to provide manual pages for each that can be accessed using similar syntax as would be used to invoke the subcommands themselves.
man
的其他实现可以做不同的事情。例如(不太好 documented ,但那里如果你研究它),在 OSX El Capitan 上快速检查 man git status
显示它试图找到status 的手册页。但是,man git-status
给出了一个手册页。
关于linux - man 如何找到 git 的子命令联机帮助页?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32747089/