"[]"代表什么?或“<"在某些命令文件中意味着什么? [英] What does "[]" or "<>" mean in some command document?

查看:96
本文介绍了"[]"代表什么?或“<"在某些命令文件中意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些命令文档中,经常有"[]"或<>".例如:

In some command documents, there are often "[]" or "<>". For example:

git diff [options] [<commit>] [--] [<path>…​]
git diff [options] --cached [<commit>] [--] [<path>…​]
git diff [options] <commit> <commit> [--] [<path>…​]

那是什么意思?

推荐答案

此符号不仅用于 git ,而且还用于一般命令的文档.

This notation is not only used for git, but for documentation of commands in general.

方括号中的参数是可选的.您可以在给定位置上自由使用它们,但也可以决定不提供任何选项.在您的示例中,您只需编写 git diff 即可,它对应于第一行,而没有任何可选参数.

Arguments in square brackets are optional. You are free to use them at the given position, but you can also decide to just not provide any option. In your example you could just write git diff which corresponds to the first line without any of the optional arguments.

尖括号中给出的项目不得逐字使用,而应由有意义的内容代替.在您的示例中,应将< commit> 替换为有效的提交标识符,例如 git diff d6cd1e2bd19e03a81132a23b2025920577f84e37 .

The items given in angle brackets are not to be used verbatim, but instead should be replaced by meaningful content. In your example, <commit> should be replaced by a valid commit identifier, e.g. git diff d6cd1e2bd19e03a81132a23b2025920577f84e37.

这篇关于"[]"代表什么?或“&lt;"在某些命令文件中意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆