This repository has been archived by the owner on Aug 15, 2023. It is now read-only.
-
比如说
感觉这两道短横不需要? const args = process.argv.slice(2);
console.log(args); $ pnpm start -n
> razor@1.0.0 start /Users/mark_chen/Documents/GitHub.nosync/razor
> tsc --build && node dist/index.js "-n"
[ '-n' ] 这样子也可以直接读取参数 |
Beta Was this translation helpful? Give feedback.
Answered by
Arondight
Nov 22, 2022
Replies: 1 comment 4 replies
-
文档From
人话约定当处理参数的库遇到选项 实战pushd /tmp/
touch -- -h
ls -l -- -h
rm -vf -- -h
popd |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
mark9804
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
文档
From
man 1 getopt
...人话
约定当处理参数的库遇到选项
--
时,表示其后的所有参数均不是选项。实战