From 078aa72127f7552271cb9bf5974a9ca5f226fdb5 Mon Sep 17 00:00:00 2001 From: Jason Pickens Date: Fri, 13 May 2022 10:00:18 +1200 Subject: [PATCH] Add support for passing arbitrary arguments --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e6f12aa..31082c8 100644 --- a/index.js +++ b/index.js @@ -18,7 +18,8 @@ let defaultOptions = { delimited: true, // 是否需要 delimited 方法 beautify: true, // 是否需要美化代码 comments: true, // 是否需要代码注释文档 - convert: true // 是否需要 from/toObject + convert: true, // 是否需要 from/toObject + args: [] }; function ProtobufPlugin(options) { this.options = options || {}; @@ -85,6 +86,9 @@ ProtobufPlugin.prototype.setBasicCommand = function () { command.push('--no-' + key); } }); + if (options.args !== undefined) { + command = command.concat(options.args); + } this.command = command; };