aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/ftp.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-07-30 01:17:09 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-07-30 02:09:30 +1200
commit4cbbd121c012b3962f12fdff0f1820c3b8636a44 (patch)
tree00149270df365ed0b7a1b9e9f4922fe7d5a80eb3 /bash/bashrc.d/ftp.bash
parentChange ca from Bash func to sh script (diff)
downloaddotfiles-4cbbd121c012b3962f12fdff0f1820c3b8636a44.tar.gz
dotfiles-4cbbd121c012b3962f12fdff0f1820c3b8636a44.zip
Move bash completion setup into separate dir
Diffstat (limited to 'bash/bashrc.d/ftp.bash')
-rw-r--r--bash/bashrc.d/ftp.bash33
1 files changed, 0 insertions, 33 deletions
diff --git a/bash/bashrc.d/ftp.bash b/bash/bashrc.d/ftp.bash
deleted file mode 100644
index 5770f137..00000000
--- a/bash/bashrc.d/ftp.bash
+++ /dev/null
@@ -1,33 +0,0 @@
-# Completion for ftp with .netrc machines
-_ftp() {
-
- # Bail if the .netrc file is illegible
- local netrc
- netrc=$HOME/.netrc
- [[ -r $netrc ]] || return 1
-
- # 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 == "${COMP_WORDS[COMP_CWORD]}"* ]] || continue
- COMPREPLY[${#COMPREPLY[@]}]=$machine
- done
-}
-complete -F _ftp -o default ftp