From 7b6f3076ea485181060707e04945c3c4b27e1e89 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 1 Dec 2018 15:17:05 +1300 Subject: Remove ftp(1) completion I don't remember the last time I used a .netrc file. --- bash/bash_completion.d/ftp.bash | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 bash/bash_completion.d/ftp.bash (limited to 'bash/bash_completion.d/ftp.bash') diff --git a/bash/bash_completion.d/ftp.bash b/bash/bash_completion.d/ftp.bash deleted file mode 100644 index f174b5ff..00000000 --- a/bash/bash_completion.d/ftp.bash +++ /dev/null @@ -1,33 +0,0 @@ -# Completion for ftp(1) with .netrc machines -_ftp() { - - # Bail if the .netrc file is illegible - local netrc - netrc=$HOME/.netrc - [[ -r $netrc ]] || return - - # Tokenize the file - local -a tokens - read -a tokens -d '' -r < "$netrc" - - # Iterate through tokens and collect machine names - local -a machines - local -i nxm - local token - for token in "${tokens[@]}" ; do - if ((nxm)) ; then - machines[${#machines[@]}]=$token - nxm=0 - elif [[ $token == machine ]] ; then - nxm=1 - fi - done - - # Generate completion reply - local machine - for machine in "${machines[@]}" ; do - [[ $machine == "$2"* ]] || continue - COMPREPLY[${#COMPREPLY[@]}]=$machine - done -} -complete -F _ftp -o bashdefault -o default ftp -- cgit v1.2.3