Skip to content

Instantly share code, notes, and snippets.

@antonagestam
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonagestam/9923206 to your computer and use it in GitHub Desktop.
Save antonagestam/9923206 to your computer and use it in GitHub Desktop.
shcmd
function __shcmd_complete(){
echo "COMPLETING WOHO!"
tput rc
tput ed
echo "COMPLETING WOHO!"
export READLINE_LINE="uh-huh"
}
function read_completion(){
set -o emacs
base_prompt="($@) $ "
completion=""
tput sc
bind -x '"\t":"echo hello;__shcmd_complete"';
read -ep "$base_prompt$completion" args
}
source ./shcmd-completion.sh
function shcmd(){
while true; do
read -p "($@) $ " args
command="$@ $args"
$command
done
}
@antonagestam
Copy link
Author

TODO: Command completion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment