From: Karen Etheridge Date: Mon, 15 Apr 2013 00:37:42 +0000 (-0700) Subject: add documentation fields for public attrs (RT#54295) X-Git-Tag: 0.16~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=399854a361242ca75d005350f6ab28c1d5e667ed;p=gitmo%2FMooseX-Daemonize.git add documentation fields for public attrs (RT#54295) --- diff --git a/Changes b/Changes index dbac9a3..f23605d 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,8 @@ Revision history for MooseX-Daemonize make_path (RT#79169, Jonathan Sailor) - add missing test dependency on Test::Exception (RT#70382) - document the 'basedir' attribute and its behaviour (RT#83055) + - add 'documentation' keys for public attributes, to be used when + displaying --help (RT#54295) 0.15 Thurs. May 31, 2012 - fix versions diff --git a/lib/MooseX/Daemonize.pm b/lib/MooseX/Daemonize.pm index 54ae47e..244d9b4 100644 --- a/lib/MooseX/Daemonize.pm +++ b/lib/MooseX/Daemonize.pm @@ -22,6 +22,7 @@ has progname => ( ( my $name = lc $_[0]->meta->name ) =~ s/::/_/g; return $name; }, + documentation => 'the name of the daemon', ); has pidbase => ( @@ -32,6 +33,7 @@ has pidbase => ( required => 1, lazy => 1, default => sub { Path::Class::Dir->new('', 'var', 'run') }, + documentation => 'the base for our pid (default: /var/run)', ); has basedir => ( @@ -42,6 +44,7 @@ has basedir => ( required => 1, lazy => 1, default => sub { Path::Class::Dir->new('/') }, + documentation => 'the directory to chdir to (default: /)', ); has foreground => ( @@ -50,13 +53,15 @@ has foreground => ( isa => 'Bool', is => 'ro', default => sub { 0 }, + documentation => 'if true, the process won\'t background', ); has stop_timeout => ( metaclass => 'Getopt', isa => 'Int', is => 'rw', - default => sub { 2 } + default => sub { 2 }, + documentation => 'number of seconds to wait for the process to stop, before trying harder to kill it (default: 2 s)', ); # internal book-keeping