mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-11-16 07:21:13 +00:00
f7cb1fee1b
These were marked deprecated for a while and has now been marked obsolete since gnu-grep 3.8 [1]. They have been removed from POSIX as well [2]. [1] https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html [2] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html#tag_20_55_18
64 lines
2.1 KiB
Bash
64 lines
2.1 KiB
Bash
#
|
|
# Provides for the interactive use of GNU utilities on BSD systems.
|
|
#
|
|
# Authors:
|
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
|
#
|
|
|
|
# Get the prefix or use the default.
|
|
zstyle -s ':prezto:module:gnu-utility' prefix '_gnu_utility_p' \
|
|
|| _gnu_utility_p='g'
|
|
|
|
# Return if requirements are not found.
|
|
if (( ! $+commands[${_gnu_utility_p}whoami] )); then
|
|
return 1
|
|
fi
|
|
|
|
_gnu_utility_cmds=(
|
|
# Coreutils
|
|
'[' 'b2sum' 'base32' 'base64' 'basename' 'basenc' 'cat' 'chcon' 'chgrp'
|
|
'chmod' 'chown' 'chroot' 'cksum' 'comm' 'cp' 'csplit' 'cut'
|
|
'date' 'dd' 'df' 'dir' 'dircolors' 'dirname' 'du' 'echo' 'env' 'expand' 'expr'
|
|
'factor' 'false' 'fmt' 'fold' 'groups' 'head' 'hostid' 'id' 'install' 'join'
|
|
'kill' 'link' 'ln' 'logname' 'ls' 'md5sum' 'mkdir' 'mkfifo'
|
|
'mknod' 'mktemp' 'mv' 'nice' 'nl' 'nohup' 'nproc' 'numfmt' 'od'
|
|
'paste' 'pathchk' 'pinky' 'pr' 'printenv' 'printf' 'ptx' 'pwd'
|
|
'readlink' 'realpath' 'rm' 'rmdir' 'runcon'
|
|
'seq' 'sha1sum' 'sha224sum' 'sha256sum' 'sha384sum' 'sha512sum' 'shred' 'shuf'
|
|
'sleep' 'sort' 'split' 'stat' 'stdbuf' 'stty' 'sum' 'sync' 'tac' 'tail'
|
|
'tee' 'test' 'timeout' 'touch' 'tr' 'true' 'truncate' 'tsort' 'tty'
|
|
'uname' 'unexpand' 'uniq' 'unlink' 'uptime' 'users' 'vdir'
|
|
'wc' 'who' 'whoami' 'yes'
|
|
|
|
# The following utilities are not part of Coreutils but installed separately.
|
|
|
|
# Binutils
|
|
'addr2line' 'ar' 'c++filt' 'coffdump' 'dlltool' 'dllwrap' 'elfedit' 'nm'
|
|
'objcopy' 'objdump' 'ranlib' 'readelf'
|
|
'size' 'srconv' 'strings' 'strip' 'sysdump' 'windmc' 'windres'
|
|
|
|
# Findutils
|
|
'find' 'locate' 'oldfind' 'updatedb' 'xargs'
|
|
|
|
# Libtool
|
|
'libtool' 'libtoolize'
|
|
|
|
# Miscellaneous
|
|
'awk' 'getopt' 'grep' 'indent' 'make' 'sed' 'tar' 'time' 'units' 'which'
|
|
)
|
|
|
|
# Wrap GNU utilities in functions.
|
|
for _gnu_utility_cmd in "${_gnu_utility_cmds[@]}"; do
|
|
_gnu_utility_pcmd="${_gnu_utility_p}${_gnu_utility_cmd}"
|
|
if (( $+commands[$_gnu_utility_pcmd] \
|
|
&& ! $+builtins[$_gnu_utility_cmd] )); then
|
|
eval "
|
|
function $_gnu_utility_cmd {
|
|
'$commands[$_gnu_utility_pcmd]' \"\$@\"
|
|
}
|
|
"
|
|
fi
|
|
done
|
|
|
|
unset _gnu_utility_{p,cmds,cmd,pcmd}
|