aboutsummaryrefslogtreecommitdiff
path: root/libs/tool
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2017-10-26 02:57:32 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2017-10-28 23:30:02 -0400
commitc7377e3eb74a73874f9d2253083b3ae952156ac8 (patch)
tree2958d720389814a0640a61625705cb6a72a9f4a9 /libs/tool
parent85934d62d767a484fa560066b6edb69a18145690 (diff)
downloadlibrebootfr-c7377e3eb74a73874f9d2253083b3ae952156ac8.tar.gz
librebootfr-c7377e3eb74a73874f9d2253083b3ae952156ac8.zip
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.
Diffstat (limited to 'libs/tool')
-rwxr-xr-xlibs/tool8
1 files changed, 4 insertions, 4 deletions
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