quilltap 4.14.0-dev.67 → 4.14.0-dev.87

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.
@@ -132,6 +132,20 @@ describe('bash completion looks up names against the addressed instance', () =>
132
132
  });
133
133
  });
134
134
 
135
+ describe('bash completion offers paths where a theme verb takes a bundle', () => {
136
+ const prefix = path.join(COMPLETION_DIR, 'bash.t');
137
+
138
+ it.each(['install', 'validate'])('completes a path after themes %s', (verb) => {
139
+ expect(bashComplete(`quilltap themes ${verb} ${prefix}`)).toContain(
140
+ path.join(COMPLETION_DIR, 'bash.template'),
141
+ );
142
+ });
143
+
144
+ it('offers no paths where the verb takes a theme id', () => {
145
+ expect(bashComplete(`quilltap themes uninstall ${prefix}`)).toEqual([]);
146
+ });
147
+ });
148
+
135
149
  describe('zsh completion parses positions instead of counting words', () => {
136
150
  const tpl = fs.readFileSync(path.join(COMPLETION_DIR, 'zsh.template'), 'utf8');
137
151
 
@@ -290,6 +290,9 @@ _quilltap_complete() {
290
290
  else
291
291
  COMPREPLY=($(compgen -W "$registry_verbs" -- "$cur"))
292
292
  fi
293
+ elif [[ "$cur" != -* ]] && [[ "$subverb" == "install" || "$subverb" == "validate" ]]; then
294
+ # A .qtap-theme file, or (validate) a bundle directory.
295
+ COMPREPLY=($(compgen -f -- "$cur"))
293
296
  else
294
297
  COMPREPLY=($(compgen -W "$themes_flags" -- "$cur"))
295
298
  fi
@@ -219,6 +219,7 @@ complete -c quilltap -n '__quilltap_using_subcommand themes' -f -a 'search' -d '
219
219
  complete -c quilltap -n '__quilltap_using_subcommand themes' -f -a 'update' -d 'Update themes'
220
220
  complete -c quilltap -n '__quilltap_using_subcommand themes' -f -a 'registry' -d 'Manage registries'
221
221
  complete -c quilltap -n '__quilltap_using_subcommand themes' -l 'output' -s 'o' -d 'Output path' -r -F
222
+ complete -c quilltap -n '__quilltap_using_subverb themes install; or __quilltap_using_subverb themes validate' -F
222
223
 
223
224
  # themes registry sub-subverbs
224
225
  complete -c quilltap -n '__quilltap_using_subverb themes registry' -f -a 'list' -d 'List registries'
@@ -428,6 +428,9 @@ _quilltap_themes() {
428
428
  registry)
429
429
  _quilltap_themes_registry
430
430
  ;;
431
+ install|validate)
432
+ _arguments $themes_opts '1:theme bundle:_files -g "*.qtap-theme(-.)"'
433
+ ;;
431
434
  *)
432
435
  _arguments $themes_opts
433
436
  ;;