Debian Codegraph @

bin/vers-tool

raw
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use utf8;
6
7 use URI::VersionRange::App;
8
9 exit URI::VersionRange::App->run(@ARGV) unless caller();
10
11 1;
12
13 __END__
14 =encoding utf-8
15
16 =head1 NAME
17
18 vers-tool - Version Range tool
19
20 =head1 SYNOPSIS
21
22 vers-tool [OPTIONS]...STRING
23 vers-tool STRING --contains STRING
24 vers-tool [--help|--man|-v]
25
26 Options:
27 --help Brief help message
28 --man Full documentation
29 -v Print version
30
31 --contains=VERSION Check if a version is contained within a range
32
33 --format=FORMAT Output format
34 --json JSON output format (--format=json)
35 -h, --human-readable Human-readable format (--format=human-readable)
36
37 Examples:
38
39 Decode a "vers" string:
40
41 vers-tool "vers:cpan/1.00|>=2.00|<5.00" | jq
42
43 Check if a version is contained within a range:
44
45 vers-tool "vers:cpan/1.00|>=2.00|<5.00" --contains "2.20"
46
47 Humanize "vers":
48
49 vers-tool "vers:cpan/1.00|>=2.00|<5.00" --human-readable
50
51 cpan
52 - equal 1.00
53 - greater than or equal 2.00
54 - less than 5.00
55
56 =head1 DESCRIPTION
57
58 C<vers-tool> Version Range tool
59
60 A version range specifier (aka. "vers") is a URI string using the C<vers> URI-scheme with this syntax:
61
62 vers:<versioning-scheme>/<version-constraint>|<version-constraint>|...
63
64 C<vers> is the URI-scheme and is an acronym for "VErsion Range Specifier".
65
66 The pipe "|" is used as a simple separator between C<version-constraint>.
67 Each C<version-constraint> in this pipe-separated list contains a comparator and a version:
68
69 <comparator:version>
70
71 This list of C<version-constraint> are signposts in the version timeline of a package
72 that specify version intervals.
73
74 A C<version> satisfies a version range specifier if it is contained within any
75 of the intervals defined by these C<version-constraint>.
76
77 L<https://github.com/package-url/vers-spec>
78
79 =head1 EXAMPLES
80
81 Decode a "vers" string:
82
83 vers-tool "vers:cpan/1.00|>=2.00|<5.00" | jq
84
85 Check if a version is contained within a range:
86
87 vers-tool "vers:cpan/1.00|>=2.00|<5.00" --contains "2.20"
88
89 Humanize "vers":
90
91 vers-tool "vers:cpan/1.00|>=2.00|<5.00" --human-readable
92
93 cpan
94 - equal 1.00
95 - greater than or equal 2.00
96 - less than 5.00
97
98 =head1 AUTHOR
99
100 L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt>
101
102 =head1 COPYRIGHT AND LICENSE
103
104 Copyright © 2022-2025 L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt>
105
106 You may use and distribute this module according to the same terms
107 that Perl is distributed under.