diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2017-06-23 13:55:22 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2017-06-23 13:55:22 -0400 |
commit | 4e50a92041c9f30deef1a32c995b9d5634cbed22 (patch) | |
tree | 889014b8974bb439a7a665ce991036ea5d41fd01 /libs/tool | |
parent | bdb6c0e643f9d4b4ce3e0ceba113c04bd45d5116 (diff) | |
download | librebootfr-4e50a92041c9f30deef1a32c995b9d5634cbed22.tar.gz librebootfr-4e50a92041c9f30deef1a32c995b9d5634cbed22.zip |
Remove unnecessary 'env' invocation from printf.
This reverts part of pull request #217 which called the 'env'
binary for each printf invocation.
Diffstat (limited to 'libs/tool')
-rwxr-xr-x | libs/tool | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -17,7 +17,7 @@ TOOL_ACTIONS_GENERIC="usage update execute" TOOL_ACTIONS_HELPERS="arguments" -TOOL_FUNCTIONS=$( for action in $TOOL_ACTIONS_GENERIC ; do env printf '%s\n' "$action" "$action""_check" ; done ; env printf '%s\n' "$TOOL_ACTIONS_HELPERS" ) +TOOL_FUNCTIONS=$( for action in $TOOL_ACTIONS_GENERIC ; do printf '%s\n' "$action" "$action""_check" ; done ; printf '%s\n' "$TOOL_ACTIONS_HELPERS" ) tool_include() { local tool=$1 @@ -79,7 +79,7 @@ tool_action() { if ! tool_check "$tool" then - env printf '%s\n' "Tool $tool check failed" >&2 + printf '%s\n' "Tool $tool check failed" >&2 return 1 fi @@ -97,7 +97,7 @@ tool_action() { return 0 fi - env printf '%s\n' "Tool $tool $action (with ${arguments:-no argument})" >&2 + printf '%s\n' "Tool $tool $action (with ${arguments:-no argument})" >&2 ( set -e @@ -106,10 +106,10 @@ tool_action() { if [ $? -ne 0 ] then - env printf '\n%s\n' "Tool $tool $action (with ${arguments:-no argument}) failed" >&2 + printf '\n%s\n' "Tool $tool $action (with ${arguments:-no argument}) failed" >&2 return 1 else - env printf '\n%s\n' "Tool $tool $action (with ${arguments:-no argument}) completed" >&2 + printf '\n%s\n' "Tool $tool $action (with ${arguments:-no argument}) completed" >&2 fi ) } @@ -125,7 +125,7 @@ tool_action_check() { if ! tool_check "$tool" then - env printf '%s\n' "Tool $tool check failed" >&2 + printf '%s\n' "Tool $tool check failed" >&2 return 1 fi @@ -162,7 +162,7 @@ tool_action_helper() { if ! tool_check "$tool" then - env printf '%s\n' "Tool $tool check failed" >&2 + printf '%s\n' "Tool $tool check failed" >&2 return 1 fi @@ -193,7 +193,7 @@ tool_action_arguments_recursive() { then tool_action "$action" "$tool" "$@" else - env printf '%s\n' "$action_helper_arguments" | while read argument + printf '%s\n' "$action_helper_arguments" | while read argument do tool_action_arguments_recursive "$action" "$tool" "$@" "$argument" done @@ -205,7 +205,7 @@ tool_path() { local tool_path="$root/$TOOLS/$tool" - env printf '%s\n' "$tool_path" + printf '%s\n' "$tool_path" } tool_sources_path() { @@ -224,7 +224,7 @@ tool_sources_path() { if directory_filled_check "$path" then - env printf '%s\n' "$path" + printf '%s\n' "$path" return fi done @@ -234,23 +234,23 @@ tool_usage_actions() { local tool=$1 shift - env printf '\n%s\n' 'Generic actions:' + printf '\n%s\n' 'Generic actions:' for action in $TOOL_ACTIONS_GENERIC do if function_check "$action" then - env printf '%s\n' " $action" + printf '%s\n' " $action" fi done if [ $# -gt 0 ] then - env printf '\n%s\n' 'Specific actions:' + printf '\n%s\n' 'Specific actions:' for action in "$@" do - env printf '%s\n' " $action" + printf '%s\n' " $action" done fi } @@ -259,7 +259,7 @@ tool_usage_arguments() { local tool=$1 shift - env printf '\n%s\n' 'Arguments:' + printf '\n%s\n' 'Arguments:' tool_usage_arguments_recursive "$tool" " " "$@" } @@ -275,9 +275,9 @@ tool_usage_arguments_recursive() { if ! [ -z "$action_helper_arguments" ] then - env printf '%s\n' "$action_helper_arguments" | while read argument + printf '%s\n' "$action_helper_arguments" | while read argument do - env printf '%s\n' "$spacing$argument" + printf '%s\n' "$spacing$argument" tool_usage_arguments_recursive "$tool" " $spacing" "$@" "$argument" done fi @@ -316,7 +316,7 @@ tool_file_path() { return 1 fi - env printf '%s\n' "$file_path" + printf '%s\n' "$file_path" } tool_file_test() { |