From bd2b78497d3868158a743a2c733fe46de389c3ff Mon Sep 17 00:00:00 2001 From: Flavio Poletti Date: Sun, 26 Mar 2023 15:35:13 +0200 Subject: [PATCH] Fix sub-commands detection for bundling --- Changes | 1 + lib/App/Easer/V2.pm | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 093af26..176a993 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ - Remove bug in using Params::Validate, addresses https://github.com/polettix/App-Easer/issues/11, still no test. - Fix help message for multi-valued defaults + - Fix detecting sub-commands with registered stuff (used in bundling) 2.007001 2023-03-11 15:20:07 CET - Ensure consistent listing of sub-commands when they are auto-loaded from diff --git a/lib/App/Easer/V2.pm b/lib/App/Easer/V2.pm index cb484f6..ef80f1d 100644 --- a/lib/App/Easer/V2.pm +++ b/lib/App/Easer/V2.pm @@ -520,10 +520,11 @@ sub list_children ($self) { } $self->children_prefixes; push @autoloaded_children, map { my $prefix = $_; + my $prefix_length = length($prefix); grep { !$seen{$_}++ } grep { - my $this_prefix = substr $_, 0, length $prefix; - $this_prefix eq $prefix; + (substr($_, 0, length $prefix) eq $prefix) + && (index($_, ':', $prefix_length) < 0); } keys %App::Easer::V2::registered; } $self->children_prefixes;