@clerc/plugin-completions 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -105,12 +105,15 @@ const completionsPlugin = (options = {}) => clerc.definePlugin({
105
105
  type: String,
106
106
  default: ""
107
107
  }
108
- }
108
+ },
109
+ parameters: [
110
+ "[shell]"
111
+ ]
109
112
  }).on("completions", (ctx) => {
110
113
  if (!cli._name) {
111
114
  throw new Error("CLI name is not defined!");
112
115
  }
113
- const shell = String(ctx.parameters[0] || ctx.flags.shell);
116
+ const shell = String(ctx.parameters.shell || ctx.flags.shell);
114
117
  if (!shell) {
115
118
  throw new Error("Missing shell name");
116
119
  }
package/dist/index.mjs CHANGED
@@ -101,12 +101,15 @@ const completionsPlugin = (options = {}) => definePlugin({
101
101
  type: String,
102
102
  default: ""
103
103
  }
104
- }
104
+ },
105
+ parameters: [
106
+ "[shell]"
107
+ ]
105
108
  }).on("completions", (ctx) => {
106
109
  if (!cli._name) {
107
110
  throw new Error("CLI name is not defined!");
108
111
  }
109
- const shell = String(ctx.parameters[0] || ctx.flags.shell);
112
+ const shell = String(ctx.parameters.shell || ctx.flags.shell);
110
113
  if (!shell) {
111
114
  throw new Error("Missing shell name");
112
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerc/plugin-completions",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "author": "Ray <nn_201312@163.com> (https://github.com/so1ve)",
5
5
  "description": "Clerc plugin completions",
6
6
  "keywords": [
@@ -43,8 +43,8 @@
43
43
  "clerc": "*"
44
44
  },
45
45
  "dependencies": {
46
- "@clerc/utils": "0.6.1",
47
- "clerc": "0.6.1"
46
+ "@clerc/utils": "0.7.0",
47
+ "clerc": "0.7.0"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "puild",