简体   繁体   English

如何向 Oclif 框架中的多个命令添加相同的标志?

[英]How to add same flag to multiple commands in Oclif framework?

I'm writing a CLI using Heroku's CLI framework oclif.我正在使用 Heroku 的 CLI 框架 oclif 编写 CLI。 It works great, but I have a flag that is applicable to only list type commands.它工作得很好,但我有一个仅适用于列表类型命令的标志。 How to add the same flag to multiple commands but not to all in oclif?如何将相同的标志添加到多个命令而不是 oclif 中的所有命令?

May be you have already found the answer but here is mine.也许您已经找到了答案,但这是我的答案。 You can set the value of multiple to true.您可以将 multiple 的值设置为 true。 This allows the flags to be declared multiple times.这允许多次声明标志。 By default the value of multiple is false.默认情况下,multiple 的值为 false。 Here is the link链接在这里

https://oclif.io/docs/flags https://oclif.io/docs/flags

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM