diff options
| author | Federico Angelilli <code@fedang.net> | 2023-12-22 17:18:34 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2023-12-22 17:18:34 +0100 |
| commit | 1c39c97e8c416ba33aa3ae884354966609c84476 (patch) | |
| tree | bf91c9f93994359d02bd90c7681fa53c99e9205d /compl/crypt.bash | |
| parent | 096deb6b1b038889f4bfb899a849e31d50272225 (diff) | |
Add GPLv3 license and INSTALL
Diffstat (limited to 'compl/crypt.bash')
| -rwxr-xr-x | compl/crypt.bash | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/compl/crypt.bash b/compl/crypt.bash deleted file mode 100755 index 3074ff5..0000000 --- a/compl/crypt.bash +++ /dev/null @@ -1,53 +0,0 @@ -# Bash completion -# -# Copy to /usr/share/bash-completion/completions/crypt - -_crypt() { - COMPREPLY=() - - local location="${CRYPT_PATH:-$HOME/.crypt}" - location="${location%/}/" - local cur="${COMP_WORDS[COMP_CWORD]}" - - local IFS=$'\n' - local suffix=".gpg" - - local firstitem="" - local i=0 item - local items=($(compgen -f $location$cur)) - - for item in ${items[@]}; do - [[ $item =~ /\.[^/]*$ ]] && continue - - if [[ ${#items[@]} -eq 1 ]]; then - while [[ -d $item ]]; do - local subitems=($(compgen -f "$item/")) - local filtereditems=( ) item2 - for item2 in "${subitems[@]}"; do - [[ $item2 =~ /\.[^/]*$ ]] && continue - filtereditems+=( "$item2" ) - done - if [[ ${#filtereditems[@]} -eq 1 ]]; then - item="${filtereditems[0]}" - else - break - fi - done - fi - - [[ -d $item ]] && item="$item/" - - item="${item%$suffix}" - COMPREPLY+=("${item#$location}") - if [[ $i -eq 0 ]]; then - firstitem=$item - fi - let i+=1 - done - - if [[ $i -gt 1 || ( $i -eq 1 && -d $firstitem ) ]]; then - compopt -o nospace - fi -} - -complete -o filenames -F _crypt crypt |
