From 4c11606e84bdf15062e2b5dc7ac41c32773a292c Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Wed, 25 Aug 2021 13:40:17 -0700 Subject: [PATCH] projtool.pl: make help work properly for worktrees? command Signed-off-by: Kyle J. McKay --- toolbox/projtool.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolbox/projtool.pl b/toolbox/projtool.pl index 51bc9da..d2cfbf1 100755 --- a/toolbox/projtool.pl +++ b/toolbox/projtool.pl @@ -2371,11 +2371,12 @@ sub dohelp { printf "%s version %s\n\n", $bn, $VERSION; if (defined($cmd) && $cmd ne '') { $cmd =~ s/^set(?=[a-zA-Z])//i; + $cmd =~ /^worktrees?$/ and $cmd='worktree[s]'; my $cmdhelp = ''; my ($lastmt, $incmd); foreach (split('\n', sprintf($help, $bn))) { $lastmt || $incmd or $lastmt = /^\s*$/, next; - $incmd = 1 if $lastmt && /^\s*(?:\[?set\]?)?$cmd\s/; + $incmd = 1 if $lastmt && /^\s*(?:\[?set\]?)?\Q$cmd\E\s/; last if $incmd && /^\s*$/; $incmd and $cmdhelp .= $_ . "\n"; $lastmt = /^\s*$/; -- 2.11.4.GIT