From 0df4757860585f31b3047fe3c4d673a9c51db47e Mon Sep 17 00:00:00 2001 From: anekos Date: Sun, 10 Apr 2011 23:42:40 +0900 Subject: サブコマンド追加 --- function-template.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'function-template.js') 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 ); -- cgit v1.2.3