Skip to content

Commit 17f6f69

Browse files
committed
allow strings for backup script index option
Using command line options, the index option will always be assigned as an arrayref. But the default was still a plain string, which would error if no index option was given. The default could be changed to an array ref, but it also makes sense to coerce a normal string.
1 parent 13f4036 commit 17f6f69

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/MetaCPAN/Types/TypeTiny.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,8 @@ declare CommaSepOption, as ArrayRef [ StrMatch [qr{^[^, ]+$}] ];
132132
coerce CommaSepOption, from ArrayRef [Str], via {
133133
return [ map split(/\s*,\s*/), @$_ ];
134134
};
135+
coerce CommaSepOption, from Str, via {
136+
return [ map split(/\s*,\s*/), $_ ];
137+
};
135138

136139
1;

0 commit comments

Comments
 (0)