From 9ea3fa0bc899cf54ffb18fe725a6a536c7072334 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 28 Jul 2020 11:08:14 -0700 Subject: [PATCH] {proj,user}tool.pl: add missing parentheses around test Add the missing pair of '('...')' to make the ugly warnings go away when certain commands are run with no arguments (e.g. 'list'). Signed-off-by: Kyle J. McKay --- toolbox/projtool.pl | 4 ++-- toolbox/usertool.pl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toolbox/projtool.pl b/toolbox/projtool.pl index f072b9f..2d13aef 100755 --- a/toolbox/projtool.pl +++ b/toolbox/projtool.pl @@ -1890,7 +1890,7 @@ sub main { $command = "set" . $command; } exists($commands{$command}) or die "Unknown command \"$command\" -- try \"help\"\n"; - dohelp($command) if @ARGV && $ARGV[0] =~ /^(?:-h|-?-help)$/i || - $ARGV[0] =~ /^help$/i && !Girocco::Project::does_exist("help",1); + dohelp($command) if @ARGV && ($ARGV[0] =~ /^(?:-h|-?-help)$/i || + $ARGV[0] =~ /^help$/i && !Girocco::Project::does_exist("help",1)); &{$commands{$command}}(@ARGV); } diff --git a/toolbox/usertool.pl b/toolbox/usertool.pl index 33e2da8..03543ca 100755 --- a/toolbox/usertool.pl +++ b/toolbox/usertool.pl @@ -658,7 +658,7 @@ sub main { $command = "set" . $command; } exists($commands{$command}) or die "Unknown command \"$command\" -- try \"help\"\n"; - dohelp($command) if @ARGV && $ARGV[0] =~ /^(?:-h|-?-help)$/i || - $ARGV[0] =~ /^help$/i && !Girocco::User::does_exist("help",1); + dohelp($command) if @ARGV && ($ARGV[0] =~ /^(?:-h|-?-help)$/i || + $ARGV[0] =~ /^help$/i && !Girocco::User::does_exist("help",1)); &{$commands{$command}}(@ARGV); } -- 2.11.4.GIT