<分区>
.NET Core 和一些 javascript 库现在似乎对每个命令行参数使用两个连字符。
为什么现在突然发生这种情况?
它有什么(历史)意义吗?
为什么不只使用一个连字符? (我们要遵守什么约定?xNix?)
<分区>
.NET Core 和一些 javascript 库现在似乎对每个命令行参数使用两个连字符。
为什么现在突然发生这种情况?
它有什么(历史)意义吗?
为什么不只使用一个连字符? (我们要遵守什么约定?xNix?)
最佳答案
来自 What's the difference betwen the single dash and double dash flags on shell commands? (服务器故障)
A single hyphen can be followed by multiple single-character flags. A double hyphen prefixes a single, multicharacter option.
Consider this example:
tar -czf
In this example,-czf
specifies three single-character flags:c
,z
, andf
.Now consider another example:
tar --exclude
In this case,--exclude
specifies a single, multicharacter option named exclude. The double hyphen disambiguates the command-line argument, ensuring that tar interprets it as exclude rather than a combination ofe
,x
,c
,l
,u
,d
, ande
关于javascript - 为什么现在命令行的每个参数后面都有两个连字符 (--)?它起源于何处,为什么不使用单个连字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58354950/