@gutenye/script.js 2.7.3 → 2.7.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gutenye/script.js",
3
- "version": "2.7.3",
3
+ "version": "2.7.4",
4
4
  "description": "Write shell scripts in JavaScript",
5
5
  "keywords": [
6
6
  "shell",
package/src/completion.ts CHANGED
@@ -61,9 +61,9 @@ export function buildSpec(command: Command): CarapaceSpec {
61
61
  spec.flags = spec.flags || {}
62
62
  let flag = [opt.short, opt.long].filter(Boolean).join(', ')
63
63
  const values = resolveCompletion(opt.completion)
64
- if (opt.required) flag += '='
64
+ if (values.length > 0) flag += '='
65
+ else if (opt.required) flag += '='
65
66
  else if (opt.optional) flag += '=?'
66
- else if (values.length > 0) flag += '='
67
67
  spec.flags[flag] = opt.description
68
68
 
69
69
  if (values.length > 0) {