aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-07-30 16:27:37 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-07-30 16:27:37 +1200
commit162c95c9cd8474790ed90daaa3c48fe5a02f9f5d (patch)
tree618c10a5c76c7f6b0ec1f101b1cca585d56ae777 /bash
parentChange cf() from Bash func to shell script (diff)
downloaddotfiles-162c95c9cd8474790ed90daaa3c48fe5a02f9f5d.tar.gz
dotfiles-162c95c9cd8474790ed90daaa3c48fe5a02f9f5d.zip
Tidy completion files
Add comments, add short-circuit to vared() completion
Diffstat (limited to 'bash')
-rw-r--r--bash/bash_completion.d/bd.bash2
-rw-r--r--bash/bash_completion.d/ftp.bash2
-rw-r--r--bash/bash_completion.d/git.bash2
-rw-r--r--bash/bash_completion.d/gpg.bash2
-rw-r--r--bash/bash_completion.d/keep.bash2
-rw-r--r--bash/bash_completion.d/mkcd.bash1
-rw-r--r--bash/bash_completion.d/path.bash1
-rw-r--r--bash/bash_completion.d/prompt.bash2
-rw-r--r--bash/bash_completion.d/vared.bash2
-rw-r--r--bash/bash_completion.d/vr.bash1
10 files changed, 10 insertions, 7 deletions
diff --git a/bash/bash_completion.d/bd.bash b/bash/bash_completion.d/bd.bash
index 68589dff..eff6cddb 100644
--- a/bash/bash_completion.d/bd.bash
+++ b/bash/bash_completion.d/bd.bash
@@ -1,4 +1,4 @@
-# Completion setup for bd
+# Completion setup for bd()
_bd() {
# Only makes sense for the first argument
diff --git a/bash/bash_completion.d/ftp.bash b/bash/bash_completion.d/ftp.bash
index 5770f137..e6d292a9 100644
--- a/bash/bash_completion.d/ftp.bash
+++ b/bash/bash_completion.d/ftp.bash
@@ -1,4 +1,4 @@
-# Completion for ftp with .netrc machines
+# Completion for ftp(1) with .netrc machines
_ftp() {
# Bail if the .netrc file is illegible
diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash
index 496712ae..8c0335c5 100644
--- a/bash/bash_completion.d/git.bash
+++ b/bash/bash_completion.d/git.bash
@@ -1,4 +1,4 @@
-# Completion for git local branch names
+# Completion for git(1) local branch names
_git() {
# Bail if not a git repo (or no git!)
diff --git a/bash/bash_completion.d/gpg.bash b/bash/bash_completion.d/gpg.bash
index c2f08415..fcb48b91 100644
--- a/bash/bash_completion.d/gpg.bash
+++ b/bash/bash_completion.d/gpg.bash
@@ -1,4 +1,4 @@
-# Completion for gpg with long options
+# Completion for gpg(1) with long options
_gpg() {
# Bail if no gpg(1)
diff --git a/bash/bash_completion.d/keep.bash b/bash/bash_completion.d/keep.bash
index bfe5dd2f..3a418bb8 100644
--- a/bash/bash_completion.d/keep.bash
+++ b/bash/bash_completion.d/keep.bash
@@ -1,2 +1,2 @@
-# Complete calls to keep with existing function names and variable names
+# Complete calls to keep() with existing function names and variable names
complete -A function -A variable keep
diff --git a/bash/bash_completion.d/mkcd.bash b/bash/bash_completion.d/mkcd.bash
index 0db967d8..a20f548e 100644
--- a/bash/bash_completion.d/mkcd.bash
+++ b/bash/bash_completion.d/mkcd.bash
@@ -1 +1,2 @@
+# Completion for mkcd(1)
complete -A directory mkcd
diff --git a/bash/bash_completion.d/path.bash b/bash/bash_completion.d/path.bash
index fd94b7c4..efead3c9 100644
--- a/bash/bash_completion.d/path.bash
+++ b/bash/bash_completion.d/path.bash
@@ -56,5 +56,4 @@ _path() {
esac
fi
}
-
complete -F _path path
diff --git a/bash/bash_completion.d/prompt.bash b/bash/bash_completion.d/prompt.bash
index b114b7bb..a2e8df4b 100644
--- a/bash/bash_completion.d/prompt.bash
+++ b/bash/bash_completion.d/prompt.bash
@@ -1,2 +1,2 @@
-# Complete words
+# Complete subcommands for the prompt wrapper
complete -W 'on off git hg svn vcs ret job' prompt
diff --git a/bash/bash_completion.d/vared.bash b/bash/bash_completion.d/vared.bash
index ea8cefd1..c2341678 100644
--- a/bash/bash_completion.d/vared.bash
+++ b/bash/bash_completion.d/vared.bash
@@ -1 +1,3 @@
+# Completion for vared() (only if defined)
+declare -F vared >/dev/null || return
complete -A variable vared
diff --git a/bash/bash_completion.d/vr.bash b/bash/bash_completion.d/vr.bash
index 2d5120f0..1b95118a 100644
--- a/bash/bash_completion.d/vr.bash
+++ b/bash/bash_completion.d/vr.bash
@@ -1 +1,2 @@
+# Completion for vr()
complete -A directory vr