File tree 2 files changed +27
-3
lines changed
2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -1249,11 +1249,19 @@ def bash(self,):
1249
1249
1250
1250
COMP_WORDS_AS_STRING=$(IFS=. ; echo "${COMP_WORDS[*]}")
1251
1251
1252
+ if echo "${prev}" | grep -q '\-\-.*file$'
1253
+ then
1254
+ CUR_PARAM_IS_FILE=1
1255
+ else
1256
+ CUR_PARAM_IS_FILE=0
1257
+ fi
1258
+
1252
1259
{% raw %}
1253
1260
for (( idx=${#COMP_WORDS[@]}-1 ; idx>=0 ; idx-- )) ; do
1254
1261
item="${COMP_WORDS[idx]}"
1255
1262
if [[ "${item:0:2}" == "--" ]]; then
1256
- if [[ "${item}" == "--columns" ]]; then
1263
+ if [[ "${item}" == "--columns" ]]
1264
+ then
1257
1265
LAST_PARAM_IS_COLUMNS=1
1258
1266
else
1259
1267
LAST_PARAM_IS_COLUMNS=0
@@ -1276,14 +1284,20 @@ def bash(self,):
1276
1284
then
1277
1285
{% set column_names = " ".join(columns[module_name]) %}
1278
1286
{% set param_names_without_columns = param_names.replace("--columns", "") %}
1279
- COMPREPLY=( $(compgen -W "{{column_names}} {{param_names_without_columns}}" -- $cur) )
1287
+ COMPREPLY=( $(compgen -W "{{column_names}}" -- $cur) )
1288
+ COMPREPLY+=( $(compgen -W "{{param_names_without_columns}}" -- $cur) )
1280
1289
else
1281
1290
COMPREPLY=( $(compgen -W "{{param_names}}" -- $cur) )
1282
1291
fi
1283
1292
;;
1284
1293
{% else %}
1285
1294
*"hpecp.{{module_name}}.{{function_name}}"*)
1286
- COMPREPLY=( $(compgen -W "{{param_names}}" -- $cur) )
1295
+ if [[ $CUR_PARAM_IS_FILE == 1 ]]
1296
+ then
1297
+ COMPREPLY=( $(compgen -W "$(ls)" -- $cur) )
1298
+ else
1299
+ COMPREPLY=( $(compgen -W "{{param_names}}" -- $cur) )
1300
+ fi
1287
1301
;;
1288
1302
{% endif %}
1289
1303
{% endfor %}
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -x
4
+ set -e
5
+
6
+ pip install -e .
7
+
8
+ hpecp autocomplete bash > ~ /hpecp_completion.sh
9
+
10
+ source ~ /hpecp_completion.sh
You can’t perform that action at this time.
0 commit comments