-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
94 lines (57 loc) · 2.18 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
*===========================*
| MooseX-Getopt-Usage |
*===========================*
Perl Moose Role that extends L<MooseX::Getopt> to provide usage printing
that inspects your classes meta information to build a (coloured) usage
message including that meta information.
SYNOPSIS
## In your class
package My::App;
use Moose;
with 'MooseX::Getopt::Usage',
'MooseX::Getopt::Usage::Role::Man';
has verbose => ( is => 'ro', isa => 'Bool', default => 0,
documentation => qq{Say lots about what we are doing} );
has gumption => ( is => 'rw', isa => 'Int', default => 23,
documentation => qq{How much gumption to apply} );
# ... rest of class
## In your script
#!/usr/bin/perl
use My::App;
my $app = My::App->new_with_options;
Can now get help,
$ synopsis.pl -?
Usage:
synopsis.pl [OPTIONS]
Options:
--man - Bool. Display man page
--help -? --usage - Bool. Display the usage message and exit
--verbose - Bool. Say lots about what we are doing
--gumption - Int. Default=23. How much gumption to apply
as well as man page:
$synopsis.pl --man
INSTALLATION
To install from CPAN
sudo cpan MooseX::Getopt::Usage
To install from the src, run the following commands:
perl Build.PL
./Build
./Build test
./Build install
Note on systems with checkinstall use
checkinstall ./Build install
If you want to create an uninstallable package.
SUPPORT AND DOCUMENTATION
You can find documentation for this module with the perldoc command.
perldoc MooseX::Getopt::Usage
The source code and other information is hosted on github:
http://github.com/markpitchless/moosex-getopt-usage
You can browse documentation on CPAN:
https://metacpan.org/module/MooseX::Getopt::Usage
http://search.cpan.org/~pitchless/MooseX-Getopt-Usage/lib/MooseX/Getopt/Usage.pm
LICENSE AND COPYRIGHT
Copyright (C) 2012 Mark Pitchless
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.