linux - man 如何找到 git 的子命令联机帮助页?

标签 linux git macos manpage

在我的 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/

相关文章:

linux - 如何用 linux 对数字求和

macos - 创建 EC2 集群 : 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)

linux - 在类 Unix 操作系统上重新映射系统范围的 key

sql - 带引号的字符串未正确终止

Ruby koans 存储库关闭

macos - bitbucket git push 身份验证失败 (mac os x)

ios - Metal Device (MTLDevice) 变量在初始化后变为 nil

macos - 在 MacOS 中安装 gcutil 时收到错误

ruby - 当 shell 有子进程时,为什么 ruby​​ 的 PTY 库无法捕获输入?

git - 我可以在git中分离一个项目吗?