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 94 95 96 97 98 99 100
|
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use URI::PackageURL::App;
exit URI::PackageURL::App->run(@ARGV) unless caller();
1;
__END__
=encoding utf-8
=head1 NAME
purl-tool - Package URL tool
=head1 SYNOPSIS
purl-tool [OPTIONS]...STRING
purl-tool --type STRING [--namespace STRING] --name STRING [--version STRING] [--subpath STRING] [--qualifier KEY=VALUE [...]]
purl-tool [--help|--man|-v]
Options:
--help Brief help message
--man Full documentation
-v Print version
"purl" string encode options:
--type=STRING Type
--namespace=STRING Namespace (optional)
--name=STRING Name
--version=STRING Version (optional)
--qualifier KEY=VALUE Qualifier key-value (optional)
"purl" string decode options:
--download-url Download URL
--repository-url Repository URL
-0, --null Return NULL char instead of new line
--format=FORMAT Output format
--dumper Data::Dumper format (--format=dumper)
--json JSON output format (--format=json)
--yaml YAML output format (--format=yaml)
--env ENV output format (--format=env)
Examples:
Parse the given Package URL string and return JSON and send the STDOUT to jq:
purl-tool pkg:cpan/GDT/URI-PackageURL@2.11 --json | jq
Download the package from the repository using Package URL string:
wget $(purl-tool pkg:cpan/GDT/URI-PackageURL@2.11 --download-url)
Create a canonical Package URL string
purl-tool --type cpan \
--namespace GDT \
--name URI-PackageURL \
--version 2.11
=head1 DESCRIPTION
C<purl-tool> Package URL tool
=head1 EXAMPLES
Parse the given Package URL string and return JSON and send the STDOUT to L<jq>:
purl-tool pkg:cpan/GDT/URI-PackageURL@2.11 --json | jq
Download the package from the repository using Package URL string:
wget $(purl-tool pkg:cpan/GDT/URI-PackageURL@2.11 --download-url)
Create a canonical Package URL string:
purl-tool --type cpan \
--namespace GDT \
--name URI-PackageURL \
--version 2.11
=head1 AUTHOR
L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt>
=head1 COPYRIGHT AND LICENSE
Copyright © 2022-2024 L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt>
You may use and distribute this module according to the same terms
that Perl is distributed under.
|