| 1 | package Map::Tube::CLI::Option; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use version; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | our $VERSION = qv('v1.2.0'); | |
| 8 | 1 | our $AUTHORITY = 'cpan:MANWAR'; | |
| 9 | |||
| 10 | =head1 NAME | ||
| 11 | |||
| 12 | Map::Tube::CLI::Option - Option as Moo Role for Map::Tube::CLI. | ||
| 13 | |||
| 14 | =head1 VERSION | ||
| 15 | |||
| 16 | Version v1.2.0 | ||
| 17 | |||
| 18 | =cut | ||
| 19 | |||
| 20 | 1 | ▶ | use 5.014; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 1 | ▶ | use Data::Dumper; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | 1 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 24 | 1 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 25 | |||
| 26 | 1 | ▶ | use Types::Standard -all; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 27 | 1 | ▶ | use MooX::Options; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 28 | |||
| 29 | 1 | has maps => (is => 'rw'); | |
| 30 | 1 | option map => (is => 'ro', order => 1, isa => Str, format => 's', doc => 'Map name', short => 'm'); | |
| 31 | 1 | option start => (is => 'ro', order => 2, isa => Str, format => 's', doc => 'Start station name', short => 's'); | |
| 32 | 1 | option end => (is => 'ro', order => 3, isa => Str, format => 's', doc => 'End station name', short => 'e'); | |
| 33 | 1 | option preferred => (is => 'ro', order => 4, doc => 'Show preferred route', short => 'p'); | |
| 34 | 1 | option generate_map => (is => 'ro', order => 5, doc => 'Generate map as image', short => 'g'); | |
| 35 | 1 | option image => (is => 'ro', order => 6, isa => Str, format => 's', doc => 'Name of image file or format (optional; default format: PNG)', short => 'i'); | |
| 36 | 1 | option layout => (is => 'ro', order => 7, isa => Str, format => 's', doc => 'Layout strategy for image (default: dot)'); | |
| 37 | 1 | option bgcolor => (is => 'ro', order => 8, isa => Str, format => 's', doc => 'Map background color', short => 'b'); | |
| 38 | 1 | option line => (is => 'ro', order => 9, isa => Str, format => 's', doc => 'Line name to map', short => 'l'); | |
| 39 | 1 | option line_mappings => (is => 'ro', order => 10, doc => 'Generate line mappings as table'); | |
| 40 | 1 | option line_notes => (is => 'ro', order => 11, doc => 'Generate line notes'); | |
| 41 | 1 | option list_maps => (is => 'ro', order => 12, doc => 'List supported maps', short => 'M'); | |
| 42 | 1 | option list_lines => (is => 'ro', order => 13, doc => 'List lines in given map', short => 'L'); | |
| 43 | 1 | option list_stations => (is => 'ro', order => 14, doc => 'List stations in given map', short => 'S'); | |
| 44 | 1 | option fuzzy => (is => 'ro', order => 15, negatable => 1, doc => 'Fuzzy station name matching (on by default if needed; switch off with --no-fuzzy)', short => 'F'); | |
| 45 | 1 | option penalty => (is => 'ro', order => 16, isa => Num, format => 'f', doc => 'Change hop count penalty for line changes (default: 0.5)', short => 'P'); | |
| 46 | 1 | option tabular => (is => 'ro', order => 17, doc => 'Show routes and notes in tabular format', short => 't'); | |
| 47 | 1 | option force => (is => 'ro', order => 18, doc => 'Obsolete. Does nothing. Kept for compatibility only.', short => 'f'); | |
| 48 | 1 | option debug => (is => 'ro', order => 19, doc => 'Run in debug mode', short => 'D'); | |
| 49 | 1 | option version => (is => 'ro', order => 20, doc => 'Show version information', short => 'V'); | |
| 50 | |||
| 51 | =head1 DESCRIPTION | ||
| 52 | |||
| 53 | B<FOR INTERNAL USE ONLY> | ||
| 54 | |||
| 55 | =head1 AUTHOR | ||
| 56 | |||
| 57 | Mohammad Sajid Anwar, C<< <mohammad.anwar at yahoo.com> >> | ||
| 58 | |||
| 59 | =head1 CONTRIBUTORS | ||
| 60 | |||
| 61 | Gisbert W. Selke, C<< <gws at cpan.org> >> | ||
| 62 | |||
| 63 | =head1 REPOSITORY | ||
| 64 | |||
| 65 | L<https://github.com/manwar/Map-Tube-CLI> | ||
| 66 | |||
| 67 | =head1 BUGS | ||
| 68 | |||
| 69 | Please report any bugs or feature requests through the web interface at L<https://github.com/manwar/Map-Tube-CLI/issues>. | ||
| 70 | I will be notified and then you'll automatically be notified of progress on your | ||
| 71 | bug as I make changes. | ||
| 72 | |||
| 73 | =head1 SUPPORT | ||
| 74 | |||
| 75 | You can find documentation for this module with the perldoc command. | ||
| 76 | |||
| 77 | perldoc Map::Tube::CLI::Option | ||
| 78 | |||
| 79 | You can also look for information at: | ||
| 80 | |||
| 81 | =over 4 | ||
| 82 | |||
| 83 | =item * BUG Report | ||
| 84 | |||
| 85 | L<https://github.com/manwar/Map-Tube-CLI/issues> | ||
| 86 | |||
| 87 | =item * Search MetaCPAN | ||
| 88 | |||
| 89 | L<http://metacpan.org/dist/Map-Tube-CLI/> | ||
| 90 | |||
| 91 | =back | ||
| 92 | |||
| 93 | =head1 LICENSE AND COPYRIGHT | ||
| 94 | |||
| 95 | Copyright (C) 2015 - 2026 Mohammad Sajid Anwar. | ||
| 96 | |||
| 97 | This program is free software; you can redistribute it and / or modify it under | ||
| 98 | the terms of the the Artistic License (2.0). You may obtain a copy of the full | ||
| 99 | license at: | ||
| 100 | |||
| 101 | L<http://www.perlfoundation.org/artistic_license_2_0> | ||
| 102 | |||
| 103 | Any use, modification, and distribution of the Standard or Modified Versions is | ||
| 104 | governed by this Artistic License.By using, modifying or distributing the Package, | ||
| 105 | you accept this license. Do not use, modify, or distribute the Package, if you do | ||
| 106 | not accept this license. | ||
| 107 | |||
| 108 | If your Modified Version has been derived from a Modified Version made by someone | ||
| 109 | other than you,you are nevertheless required to ensure that your Modified Version | ||
| 110 | complies with the requirements of this license. | ||
| 111 | |||
| 112 | This license does not grant you the right to use any trademark, service mark, | ||
| 113 | tradename, or logo of the Copyright Holder. | ||
| 114 | |||
| 115 | This license includes the non-exclusive, worldwide, free-of-charge patent license | ||
| 116 | to make, have made, use, offer to sell, sell, import and otherwise transfer the | ||
| 117 | Package with respect to any patent claims licensable by the Copyright Holder that | ||
| 118 | are necessarily infringed by the Package. If you institute patent litigation | ||
| 119 | (including a cross-claim or counterclaim) against any party alleging that the | ||
| 120 | Package constitutes direct or contributory patent infringement,then this Artistic | ||
| 121 | License to you shall terminate on the date that such litigation is filed. | ||
| 122 | |||
| 123 | Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND | ||
| 124 | CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED | ||
| 125 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR | ||
| 126 | NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS | ||
| 127 | REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, | ||
| 128 | INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE | ||
| 129 | OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 130 | |||
| 131 | =cut | ||
| 132 | |||
| 133 | 1 | 1; # End of Map::Tube::CLI::Option | |