diff --git a/qcd_function b/qcd_function index 801ccc9..e22c431 100644 --- a/qcd_function +++ b/qcd_function @@ -362,6 +362,19 @@ function qbg { } "$@" &> /dev/null & } +_qbg() +{ + local cur + cur=${COMP_WORDS[COMP_CWORD]} + if [[ "$COMP_CWORD" == 1 ]]; then + local executables + executables=$({ compgen -c; compgen -abkA function; } | sort | uniq -u ) + COMPREPLY=( $( compgen -W "$executables" -- "$cur" ) ) + return 0 + fi + COMPREPLY=( $( compgen -fd -- "$cur" ) ) +} +complete -F _qbg qbg function set_term_title { # set term in byobu/screen xterm etc.. @@ -393,6 +406,7 @@ function path_add_current { path_remove_duplicates echo PATH=$PATH } + function path_remove_duplicates { # Remove duplicates in PATH PATH=$( echo $PATH | awk -F: '{for (i=1;i<=NF;i++) { if ( !x[$i]++ ) printf("%s:",$i); }}' | sed 's,:\+$,,g' )