javascript - 为什么现在命令行的每个参数后面都有两个连字符 (--)?它起源于何处,为什么不使用单个连字符?

标签 javascript node.js asp.net-core .net-core

<分区>

.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, and f.

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 of e, x, c, l, u, d, and e

关于javascript - 为什么现在命令行的每个参数后面都有两个连字符 (--)?它起源于何处,为什么不使用单个连字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58354950/

相关文章:

javascript - d3.js 和谷歌地图 API 的多条路径

javascript - 按时间间隔添加值时,多个图表不会随机同步移动

node.js - async.each 表插入麻烦?

c# - 在 ASP.NET MVC [非静态] 中声明全局 Razor 页面变量

c# - 更改连接字符串后 ASP.NET Core 重新注册 dbcontext

javascript - JQuery - 相对于按钮定位弹出窗口

javascript - 我如何在angularjs中格式化json?

mysql - Node.js 更新 mysql 数据库

mysql - 在 mysql 数据库池中请求连接时达到用户限制

asp.net-core - MVC 6 安装为 Windows 服务 (ASP.NET Core 1.0.0)