use insertion order to sort attributes when formulating arguments for Getopt::Long
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / Basic.pm
index 9a6c79a..44d683c 100644 (file)
@@ -158,6 +158,7 @@ sub _traditional_spec {
 
 sub _compute_getopt_attrs {
     my $class = shift;
+    sort { $a->insertion_order <=> $b->insertion_order }
     grep {
         $_->does("MooseX::Getopt::Meta::Attribute::Trait")
             or