aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/vis.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-10-13 17:47:08 +1300
committerTom Ryder <tom@sanctum.geek.nz>2014-10-13 17:47:08 +1300
commit498954539dec625e8e53637f96b32658105d1631 (patch)
tree08d477fb3e2042d136f2ee7a794b36a5403b7a3b /bash/bashrc.d/vis.bash
parentRemembered that VERSINFO[2] is broken on 2.05a (diff)
downloaddotfiles-498954539dec625e8e53637f96b32658105d1631.tar.gz
dotfiles-498954539dec625e8e53637f96b32658105d1631.zip
Remove never-used vis function
Diffstat (limited to 'bash/bashrc.d/vis.bash')
-rw-r--r--bash/bashrc.d/vis.bash39
1 files changed, 0 insertions, 39 deletions
diff --git a/bash/bashrc.d/vis.bash b/bash/bashrc.d/vis.bash
deleted file mode 100644
index ffcfe02a..00000000
--- a/bash/bashrc.d/vis.bash
+++ /dev/null
@@ -1,39 +0,0 @@
-# Create or edit a script in $PATH, creating in $HOME/.local/bin
-vis() {
- local arg cmd file endopts
- local -a opts cmds files
-
- # Distinguish options from file arguments
- endopts=0
- for arg in "${@:?}" ; do
- if [[ $arg == -- ]] ; then
- endopts=1
- elif [[ $arg == -* ]] && ! ((endopts)) ; then
- opts=("${opts[@]}" "$arg")
- else
- cmds=("${cmds[@]}" "$arg")
- fi
- done
-
- # Check all the commands, if they don't exist, we'll create them
- for cmd in "${cmds[@]}" ; do
- file=$(type -p "${cmd##*/}")
- if [[ ! $file ]] ; then
- if ! mkdir -p "$HOME"/.local/bin ; then
- exit
- fi
- file="$HOME"/.local/bin/"${cmd##*/}"
- fi
- files=("${files[@]}" "$file")
- done
-
- # Run editor with all the options and full path file arguments
- command "${VISUAL:-${EDITOR:-vi}}" "${opts[@]}" -- "${files[@]}"
-
- # Attempt to make the new files executable by us
- chmod -f -- u+x "${files[@]}"
-}
-
-# Complete the vis function with command names
-complete -A command vis
-