有风塘主
发布于 2024-10-26 / 39 阅读
0
0

Commander.js术语表

Commander.js术语表

来源:https://github.com/tj/commander.js/blob/master/docs/zh-CN/%E6%9C%AF%E8%AF%AD%E8%A1%A8.md

命令行参数由选项(options)、选项参数(option-arguments)、命令(commands),以及命令参数(command-arguments)组成。

术语解释
选项(option)-后跟单个字母,或--后跟单词(或以-连接的多个单词),例如-s--short
选项参数(option-argument)有的选项可以接受一个参数
命令(command)一个程序或命令可以包含子命令
命令参数(command-argument)传给命令的参数(不包含选项或选项参数)

例如:

my-utility command -o --option option-argument command-argument-1 command-argument-2

在一些其他资料中,选项有时也称为标志(flags),而命令参数也被称为位置参数(positional arguments)或者操作数(operands)。


评论