aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-01 15:17:05 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-02 12:42:21 +1300
commit7b6f3076ea485181060707e04945c3c4b27e1e89 (patch)
tree15943c1c1363288043c03621fe4bdbb4ee61baa8
parentRemove `kill` completion (diff)
downloaddotfiles-7b6f3076ea485181060707e04945c3c4b27e1e89.tar.gz
dotfiles-7b6f3076ea485181060707e04945c3c4b27e1e89.zip
Remove ftp(1) completion
I don't remember the last time I used a .netrc file.
-rw-r--r--README.md1
-rw-r--r--bash/bash_completion.d/ftp.bash33
2 files changed, 0 insertions, 34 deletions
diff --git a/README.md b/README.md
index ae9b4319..de4e8618 100644
--- a/README.md
+++ b/README.md
@@ -264,7 +264,6 @@ files, for things I really do get tired of typing repeatedly:
* Bash builtins: commands, help topics, shell options, variables, etc.
* `find(1)`'s more portable options
-* `ftp(1)` hostnames from `~/.netrc`
* `git(1)` subcommands, remotes, branches, tags, and addable files
* `gpg(1)` long options
* `make(1)` targets read from a `Makefile`
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