the*_*ppo 9 windows git cmd windows-console
git help
Windows(msysgit
发行版)上的命令每次运行时都会生成Web浏览器.我尝试了git help -m
哪些报告"No manual entry for ..."
,哪些报告git help -i
说"info: Terminal type 'msys' is not smart enough to run Info."
同样的情况发生在bash
下面Cygwin
.
在cmd
终端有没有明智的方法来获得轻量级的帮助?
它适用于特定命令: git <command> -h
编辑,感谢@ the-happy-hippo
但它仅显示一个简要说明,不完整的一个,作为git help <command>
或git <command> --help
Windows上给出。
Git 2.x 更新(2017 年 6 月,Git 2.13.1)
\n你还没有男人:
\n> git -c help.format=man help add\nwarning: failed to exec \'man\': No such file or directory\nfatal: no man viewer handled the request\n
Run Code Online (Sandbox Code Playgroud)\n对于 也一样git <verb> --help
。
\ngit <verb> -h
不打印手册页,只打印简短的用法部分(与 man 无关)
在 Git 2.34(2021 年第 4 季度)中,当git cmd -h
显示多行使用文本(例如 cmd 子命令可能需要 sub-sub-command)时,parse-options API 学会了对齐这些行,甚至跨i18n / l10n也是如此。
请参阅\xc3\x86var Arnfj\xc3\xb6r\xc3\xb0 Bjarmason ( )提交的提交 4631cfc(2021 年 9 月 21 日)、提交 84122ec、提交 78a5091、提交 5d70198(2021 年 9 月 13 日)。\n (由Junio C Hamano 合并 -- --在提交 d7bc852中,2021 年 10 月 13 日)avar
gitster
\n\n\n
parse-options
:正确调整持续使用输出签署人:\xc3\x86var Arnfj\xc3\xb6r\xc3\xb0 Bjarmason
\n
\n\n某些命令(例如“
\ngit stash
” (man))会使用eg发出连续的选项输出git stash -h
,因为usage_with_options_internal()
带有自己的空格的前缀导致结果输出未正确对齐。
\n让我们考虑添加的空白,它可以正确对齐输出。“
\ngit stash
”命令具有带有 N_() 转换的用法输出,该转换合法地跨多行延伸;Run Code Online (Sandbox Code Playgroud)\nN_("git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\\n"\n " [-u|--include-untracked] [-a|--all] [-m|--message <message>]\\n"\n[...]\n
我们希望该输出与初始“
\ngit stash
”输出的长度对齐,但由于usage_with_options_internal()
添加了自己的空格前缀,我们未能达到要求,在此更改之前我们会发出:Run Code Online (Sandbox Code Playgroud)\n$ git stash -h\nusage: git stash list [<options>]\n or: git stash show [<options>] [<stash>]\n [...]\n or: git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n [...]\n
现在我们将正确发出对齐的输出。
\n
\n即
\n上面的最后四行将改为(仅对上面的空格进行更改):Run Code Online (Sandbox Code Playgroud)\n[...]\nor: git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n [...]\n
此更改相对更复杂,因为我已考虑使其能够面向未来的 RTL 翻译支持。
\n
\n稍后usage_with_options_internal()
我们有一些可追溯到d7a38c5的现有填充代码(“parse-options
:能够自动生成用法”,2007-10-15,Git v1.5.4-rc0 -- merge),它不是 RTL 安全的,但是该代码很容易修复。
\n我们不要在这里引入新的 RTL 翻译问题。
原始答案(2014)
\n不,尽管“如何让 git 在 Windows 中显示命令行帮助? ”中建议了基于 htlp txt 文件的“cat”的替代方案。
\nman.<tool>.cmd
2008 年引入的配置允许设置自定义命令,但 msys shell 不随man.exe
.
归档时间: |
|
查看次数: |
1999 次 |
最近记录: |