Skip to content

Commit

Permalink
Fixed situation where sub_command isn't a hashref
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanwills-optus committed Apr 27, 2020
1 parent e8a8372 commit 28ebf0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Getopt/Alt.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 28ebf0b

Please sign in to comment.