Linux comand line autocomplete
INDICATORS_DIR=/projects/equities/simulation/indicators _daily_indicator_complete() { local cur prev words cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" words="${COMP_WORDS[*]}" # Only activate when command line contains daily_*.py [[ "$words" == *daily_*.py* ]] || return if [[ "$prev" == "-i" || "$cur" == *,* ]]; then local indicators=$(ls "$INDICATORS_DIR"/*.py 2>/dev/null \ | xargs -n1 basename | sed 's/\.py$//' | sort -u) if [[ "$cur" == *,* ]]; then local prefix="${cur%,*}," local last="${cur##*,}" ...