Created
June 19, 2012 21:26
-
-
Save cabo/2956641 to your computer and use it in GitHub Desktop.
.profile snippet for completed command line eject (via hdiutil)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ej() { | |
for i | |
do | |
echo ejecting /Volumes/"$i"... | |
hdiutil eject /Volumes/"$i" | |
done | |
} | |
function _ej() { | |
local cur="${COMP_WORDS[COMP_CWORD]}" | |
local v=$(cd /Volumes/; find -x . -type d -depth 1 | sed s/..//) | |
COMPREPLY=( $(compgen -W "$v" -- $cur) ) | |
} | |
complete -F _ej ej |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment