gdb: Improve filename completion.
Only core files where appropriate, turn on -o filenames, drop -o default.
This commit is contained in:
parent
a4fa9bb3eb
commit
f815736ffe
@ -27,12 +27,14 @@ _gdb()
|
|||||||
-printf "%f\\n" 2>/dev/null)' -- "$cur" ) )
|
-printf "%f\\n" 2>/dev/null)' -- "$cur" ) )
|
||||||
fi
|
fi
|
||||||
elif [ $cword -eq 2 ]; then
|
elif [ $cword -eq 2 ]; then
|
||||||
prev=${prev##*/}
|
COMPREPLY=( $( compgen -W "$( command ps axo comm,pid | \
|
||||||
COMPREPLY=( $( compgen -fW "$( command ps axo comm,pid | \
|
awk '{if ($1 ~ /^'"${prev##*/}"'/) print $2}' )" -- "$cur" ) )
|
||||||
awk '{if ($1 ~ /^'"$prev"'/) print $2}' )" -- "$cur" ) )
|
compopt -o filenames
|
||||||
|
COMPREPLY+=( $( compgen -f -X '!?(*/)core?(.+([0-9]))' -o plusdirs \
|
||||||
|
-- "$cur" ) )
|
||||||
fi
|
fi
|
||||||
} &&
|
} &&
|
||||||
complete -F _gdb -o default gdb
|
complete -F _gdb gdb
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# mode: shell-script
|
# mode: shell-script
|
||||||
|
Loading…
x
Reference in New Issue
Block a user