PageRenderTime 121ms CodeModel.GetById 118ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/zsh_command_not_found

http://github.com/brinkman83/bashrc
#! | 25 lines | 20 code | 5 blank | 0 comment | 0 complexity | d8030e5bf568d7d6d126f88f70399e52 MD5 | raw file
 1# (c) Zygmunt Krynicki 2007,
 2# Licensed under GPL, see COPYING for the whole text
 3#
 4# This script will look-up command in the database and suggest
 5# installation of packages available from the repository
 6
 7# Pseudo-namespace cnf_
 8
 9function cnf_preexec() {
10	typeset -g cnf_command="${1%% *}"
11}
12
13function cnf_precmd() {
14	(($?)) && [ -n "$cnf_command" ] && [ -x /usr/lib/command-not-found ] && {
15		whence -- "$cnf_command" >& /dev/null ||
16			/usr/bin/python /usr/lib/command-not-found -- "$cnf_command"
17		unset cnf_command
18	}
19}
20
21typeset -ga preexec_functions
22typeset -ga precmd_functions
23preexec_functions+=cnf_preexec
24precmd_functions+=cnf_precmd
25