From 7bf5773b3d594c104d31ea315532c9c1539dd19b Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Wed, 11 Apr 2012 16:11:07 -0400 Subject: [PATCH] Rename gnu-utils to gnu-utility --- modules/{gnu-utils => gnu-utility}/README.md | 6 +++--- modules/{gnu-utils => gnu-utility}/init.zsh | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) rename modules/{gnu-utils => gnu-utility}/README.md (90%) rename modules/{gnu-utils => gnu-utility}/init.zsh (76%) diff --git a/modules/gnu-utils/README.md b/modules/gnu-utility/README.md similarity index 90% rename from modules/gnu-utils/README.md rename to modules/gnu-utility/README.md index 06f2cb9..4a0be81 100644 --- a/modules/gnu-utils/README.md +++ b/modules/gnu-utility/README.md @@ -1,5 +1,5 @@ -gnu-utils -========= +gnu-utility +=========== Provides for the interactive use of [GNU Core Utilities][1] on non-GNU systems. @@ -18,7 +18,7 @@ Settings To use a different prefix, add the following to *zshrc*, and replace 'g' with the desired prefix: - zstyle ':omz:module:gnu-utils' prefix 'g' + zstyle ':omz:module:gnu-utility' prefix 'g' Authors ------- diff --git a/modules/gnu-utils/init.zsh b/modules/gnu-utility/init.zsh similarity index 76% rename from modules/gnu-utils/init.zsh rename to modules/gnu-utility/init.zsh index b578614..558ad40 100644 --- a/modules/gnu-utils/init.zsh +++ b/modules/gnu-utility/init.zsh @@ -6,14 +6,14 @@ # # Get the prefix or use the default. -zstyle -s ':omz:module:gnu-utils' prefix '_gnu_utils_p' || _gnu_utils_p='g' +zstyle -s ':omz:module:gnu-utility' prefix '_gnu_utility_p' || _gnu_utility_p='g' # Check for the presence of GNU Core Utilities. -if (( ! ${+commands[${_gnu_utils_p}dircolors]} )); then +if (( ! ${+commands[${_gnu_utility_p}dircolors]} )); then return 1 fi -_gnu_utils_cmds=( +_gnu_utility_cmds=( # Coreutils '[' 'base64' 'basename' 'cat' 'chcon' 'chgrp' 'chmod' 'chown' 'chroot' 'cksum' 'comm' 'cp' 'csplit' 'cut' 'date' 'dd' 'df' @@ -46,16 +46,16 @@ _gnu_utils_cmds=( ) # Wrap GNU utilities in functions. -for _gnu_utils_cmd in "${_gnu_utils_cmds[@]}"; do - _gnu_utils_pcmd="${_gnu_utils_p}${_gnu_utils_cmd}" - if (( ${+commands[${_gnu_utils_pcmd}]} )); then +for _gnu_utility_cmd in "${_gnu_utility_cmds[@]}"; do + _gnu_utility_pcmd="${_gnu_utility_p}${_gnu_utility_cmd}" + if (( ${+commands[${_gnu_utility_pcmd}]} )); then eval " - function ${_gnu_utils_cmd} { - '${commands[${_gnu_utils_pcmd}]}' \"\$@\" + function ${_gnu_utility_cmd} { + '${commands[${_gnu_utility_pcmd}]}' \"\$@\" } " fi done -unset _gnu_utils_{p,cmds,cmd,pcmd} +unset _gnu_utility_{p,cmds,cmd,pcmd}