Last change
on this file since 6fe77af was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago |
primeNG components
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | exports.completionShTemplate =
|
---|
2 | `###-begin-{{app_name}}-completions-###
|
---|
3 | #
|
---|
4 | # yargs command completion script
|
---|
5 | #
|
---|
6 | # Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
|
---|
7 | # or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
|
---|
8 | #
|
---|
9 | _yargs_completions()
|
---|
10 | {
|
---|
11 | local cur_word args type_list
|
---|
12 |
|
---|
13 | cur_word="\${COMP_WORDS[COMP_CWORD]}"
|
---|
14 | args=("\${COMP_WORDS[@]}")
|
---|
15 |
|
---|
16 | # ask yargs to generate completions.
|
---|
17 | type_list=$({{app_path}} --get-yargs-completions "\${args[@]}")
|
---|
18 |
|
---|
19 | COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) )
|
---|
20 |
|
---|
21 | # if no match was found, fall back to filename completion
|
---|
22 | if [ \${#COMPREPLY[@]} -eq 0 ]; then
|
---|
23 | COMPREPLY=()
|
---|
24 | fi
|
---|
25 |
|
---|
26 | return 0
|
---|
27 | }
|
---|
28 | complete -o default -F _yargs_completions {{app_name}}
|
---|
29 | ###-end-{{app_name}}-completions-###
|
---|
30 | `
|
---|
31 |
|
---|
32 | exports.completionZshTemplate = `###-begin-{{app_name}}-completions-###
|
---|
33 | #
|
---|
34 | # yargs command completion script
|
---|
35 | #
|
---|
36 | # Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
|
---|
37 | # or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX.
|
---|
38 | #
|
---|
39 | _{{app_name}}_yargs_completions()
|
---|
40 | {
|
---|
41 | local reply
|
---|
42 | local si=$IFS
|
---|
43 | IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
|
---|
44 | IFS=$si
|
---|
45 | _describe 'values' reply
|
---|
46 | }
|
---|
47 | compdef _{{app_name}}_yargs_completions {{app_name}}
|
---|
48 | ###-end-{{app_name}}-completions-###
|
---|
49 | `
|
---|
Note:
See
TracBrowser
for help on using the repository browser.