From c7377e3eb74a73874f9d2253083b3ae952156ac8 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Thu, 26 Oct 2017 02:57:32 -0400 Subject: Make use of Bash's '-n' operator for tests As an example, do this: [[ -n $revision ]] instead of this: ! [[ -z $revision ]] Makes the code easier to read. --- libs/tool | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libs/tool') diff --git a/libs/tool b/libs/tool index c18ded8b..dc2a3d0a 100755 --- a/libs/tool +++ b/libs/tool @@ -236,7 +236,7 @@ tool_sources_path() { for argument in "" "$@" do - if ! [[ -z "$argument" ]] + if [[ -n "$argument" ]] then path="$path/$argument" fi @@ -292,7 +292,7 @@ tool_usage_arguments_recursive() { local action_helper_arguments=$( tool_action_helper "arguments" "$tool" "$@" ) local argument - if ! [[ -z "$action_helper_arguments" ]] + if [[ -n "$action_helper_arguments" ]] then printf '%s\n' "$action_helper_arguments" | while read argument do @@ -317,7 +317,7 @@ tool_file_path() { for argument in "" "$@" do - if ! [[ -z "$argument" ]] + if [[ -n "$argument" ]] then path="$path/$argument" fi @@ -368,7 +368,7 @@ tool_file_contents_herit() { for argument in "" "$@" do - if ! [[ -z "$argument" ]] + if [[ -n "$argument" ]] then path="$path/$argument" fi -- cgit v1.2.3-70-g09d2