|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | 3 | function lhs_help_helpful() { |
4 | | - # Support both function function_name() { or function_name with prefix aws_bla_bla() { |
5 | | - local lhs_functions |
6 | | - lhs_functions=$(lhs_peco_helpful_function_list) |
7 | | - local lhs_option=${1:-IgnoreCase} |
8 | | - |
9 | | - # Use peco to filter and select from the list of helpful functions |
10 | | - # LBUFFER contains the current command line buffer content |
11 | | - # The selected function will be stored in BUFFER |
12 | | - BUFFER=$( |
13 | | - # shellcheck disable=SC2153 |
14 | | - echo "${lhs_functions}" | peco --query "$LBUFFER" --initial-filter "${lhs_option}" |
15 | | - ) |
16 | | - |
17 | | - # shellcheck disable=SC2034 |
18 | | - CURSOR=$#BUFFER |
| 4 | + # Support both function function_name() { or function_name with prefix aws_bla_bla() { |
| 5 | + local lhs_functions |
| 6 | + lhs_functions=$(lhs_peco_helpful_function_list) |
| 7 | + local lhs_option=${1:-IgnoreCase} |
| 8 | + |
| 9 | + # Use peco to filter and select from the list of helpful functions |
| 10 | + # LBUFFER contains the current command line buffer content |
| 11 | + # The selected function will be stored in BUFFER |
| 12 | + BUFFER=$( |
| 13 | + # shellcheck disable=SC2153 |
| 14 | + echo "${lhs_functions}" | peco --query "$LBUFFER" --initial-filter "${lhs_option}" |
| 15 | + ) |
| 16 | + |
| 17 | + # shellcheck disable=SC2034 |
| 18 | + CURSOR=$#BUFFER |
19 | 19 |
|
20 | 20 | } |
21 | 21 |
|
22 | 22 | function lhs_help_all() { |
23 | | - # Support both function function_name() { or function_name with prefix aws_bla_bla() { |
24 | | - # shellcheck disable=SC2155 |
25 | | - local lhs_functions |
26 | | - local lhs_option |
| 23 | + # Support both function function_name() { or function_name with prefix aws_bla_bla() { |
| 24 | + # shellcheck disable=SC2155 |
| 25 | + local lhs_functions |
| 26 | + local lhs_option |
27 | 27 |
|
28 | | - lhs_functions=$(lhs_peco_function_list) |
29 | | - lhs_option=${1:-"${LHS_PECO_FILTER_TYPE}"} |
| 28 | + lhs_functions=$(lhs_peco_function_list) |
| 29 | + lhs_option=${1:-"${LHS_PECO_FILTER_TYPE}"} |
30 | 30 |
|
31 | | - # shellcheck disable=SC2034 |
32 | | - BUFFER=$( |
33 | | - echo "${lhs_functions}" | peco --query "$LBUFFER" --initial-filter "${lhs_option}" |
34 | | - ) |
| 31 | + # shellcheck disable=SC2034 |
| 32 | + BUFFER=$( |
| 33 | + echo "${lhs_functions}" | peco --query "$LBUFFER" --initial-filter "${lhs_option}" |
| 34 | + ) |
35 | 35 |
|
36 | | - # shellcheck disable=SC2034 |
37 | | - CURSOR=$#BUFFER |
| 36 | + # shellcheck disable=SC2034 |
| 37 | + CURSOR=$#BUFFER |
38 | 38 |
|
39 | 39 | } |
40 | 40 |
|
41 | 41 | function lhs_help_refresh() { |
42 | | - lhs_peco_disable_input_cached |
43 | | - lhs_peco_function_list >>/dev/null |
44 | | - lhs_peco_helpful_function_list >>/dev/null |
45 | | - lhs_peco_enable_input_cached |
| 42 | + lhs_peco_disable_input_cached |
| 43 | + lhs_peco_function_list >> /dev/null |
| 44 | + lhs_peco_helpful_function_list >> /dev/null |
| 45 | + lhs_peco_enable_input_cached |
46 | 46 |
|
47 | 47 | } |
0 commit comments