Difference between - and — (single and double dash) in npm commands

时间秒杀一切 提交于 2019-12-01 21:08:36

No, it's simply that by convention, *nix command line switches that are only one dash (-d) are only one character. Those with two dashes (--save) are multiple characters long. Both are optional.

See https://serverfault.com/questions/387935/whats-the-difference-betwen-the-single-dash-and-double-dash-flags-on-shell-comm

Basically, a single dash means that the following flags are single-character only, and generally means that more than one flag can be passed. See all other command line tools:

ls -la
grep -inr "asd" .

etc

The double dash connotes a single positional flag/argument to a command line tool.

Robin He

Generally, - is an abbreviation, there must be a corresponding -— full name.

For example:

npm install -D is equal to npm install --save-dev

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!