diff options
-rw-r--r-- | function-template.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/function-template.js b/function-template.js index f790f72..5dac6fd 100644 --- a/function-template.js +++ b/function-template.js @@ -95,7 +95,28 @@ let PLUGIN_INFO = context.completions = [ ['item1', 'desc1'], ]; - } + }, + + // サブコマンド ( aptitude install ... みたいなもの) + // Command のインスタンスの配列を渡します + subCommands: [ + new Command( + ['subA'], + 'Sub command A' + function (args) { + // addUserCommand のと同じ + }, + { + // extra options これまた addUserCommand のと同じ + } + ), + new Command( + ['subB'], + 'Sub command B' + function (args) { }, + {} + ) + ] }, true // replace ); |