From 28ebf0bdee981234b745c21b65c2a12b6cb4948d Mon Sep 17 00:00:00 2001 From: Ivan Wills Date: Mon, 27 Apr 2020 14:07:24 +1000 Subject: [PATCH] Fixed situation where sub_command isn't a hashref --- lib/Getopt/Alt.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Getopt/Alt.pm b/lib/Getopt/Alt.pm index 4b5d4e1..4aaafbf 100644 --- a/lib/Getopt/Alt.pm +++ b/lib/Getopt/Alt.pm @@ -468,7 +468,7 @@ sub process { sub complete { my ($self, $errors) = @_; - if ( $self->sub_command && !$self->cmd ) { + if ( $self->sub_command && ref $self->sub_command && !$self->cmd ) { my $cmd = shift @ARGV; my @sub_command = grep { $cmd ? /$cmd/ : 1 } sort keys %{ $self->sub_command }; print join ' ', @sub_command;