Sha256: 755be418c4f61e7e02eb161cf537a766bcd3fb7638d7429ab82d59fbff603f4b
Contents?: true
Size: 1.07 KB
Versions: 15
Compression:
Stored size: 1.07 KB
Contents
# lib/aia/aia_completion.fish # Setup a prompt completion for use with the fish shell # # This script assumes that the system environment # variable AIA_PROMPTS_DIR has been set correctly function __fish_aia_complete # Get the command line and current token set -l cmd_line (commandline -opc) set -l current_token (commandline -ct) # Check if we are currently completing the option that requires prompt IDs if set -q cmd_line[2] # Change directory to the prompts directory if test -d $AIA_PROMPTS_DIR pushd $AIA_PROMPTS_DIR # Generate completions based on .txt files in the AIA_PROMPTS_DIR directory for file in (find . -name "*.txt" -type f) set file (string replace -r '\.txt$' '' -- $file) set file (string replace -r '^\./' '' -- $file) printf "%s\n" $file end popd end else # Use the default file completion if we are not completing a prompt ID complete -f -c aia -a "(commandline -ct)" end end # Register the completion function for the aia command complete -c aia -a '(__fish_aia_complete)' -f
Version data entries
15 entries across 15 versions & 1 rubygems