* MooseX::Getopt::Session: New attribute "status".
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / Session.pm
index bdb0417..dae6c01 100644 (file)
@@ -44,12 +44,12 @@ has options => (
     default => sub { {} },
 );
 
-
-sub BUILD {
-    my ($self, $args) = @_;
-
-    $self->build_options;
-};
+# Status returned by Getopt parser
+has status => (
+    is => 'rw',
+    isa => 'Bool',
+    predicate => 'has_status',
+);
 
 
 sub build_options {
@@ -141,8 +141,8 @@ L<MooseX::Getopt::Parser>.
 
 =item B<new (%params)>
 
-This method creates new CLI session for L<MooseX::Getopt> and calls
-C<build_options> method.
+This method creates new CLI session object for L<MooseX::Getopt>.  The
+session should be started with C<build_options> method.
 
 =item B<build_options>
 
@@ -181,9 +181,10 @@ This accessor contains an arrayref of options parsed from command line by
 L<MooseX::Getopt::Parser>.  If the options list are not empty before parsing
 the command line, the old list will be included to new list.
 
-=item B<BUILD>
+=item B<status>
 
-This is a default L<Moose> constructor.
+This accessor contains a true value if L<MooseX::Getopt::Parser> was
+called via C<build_options> method and it succeeded.
 
 =item B<meta>