URI::PackageURL::App(3pm)

NAME
$type - $type_name

DESCRIPTION
$description

SYNTAX
The structure of a PURL for this package type is:

$purl_syntax

MAN

    foreach my $component (qw[namespace name version subpath]) {

        next unless $definition->component_have_definition($component);

        my $requirement          = $definition->component_requirement($component);
        my $permitted_characters = $definition->component_permitted_characters($component);
        my $normalization_rules  = $definition->component_normalization_rules($component);
        my $case_sensitive       = $definition->component_case_sensitive($component);
        my $native_name          = $definition->component_native_name($component);
        my $note                 = $definition->component_note($component);

        $man .= sprintf "=head2 %s\n\n", ucfirst $component;
        $man .= "=over 2\n\n";

        if ($requirement) {
            $man .= sprintf "=item B<Requirement>: %s\n\n", ucfirst($requirement);
        }

        if ($permitted_characters) {
            $man .= sprintf "=item B<Permitted Characters>: %s\n\n", ucfirst($permitted_characters);
        }

        if ($case_sensitive) {
            $man .= sprintf "=item B<Is Case Sensitive>: %s\n\n", ($case_sensitive ? 'Yes' : 'No');
        }

        if (@{$normalization_rules}) {

            $man .= "=item B<Normalization Rules>:\n\n";
            $man .= "=over 2\n\n";

            foreach (@{$normalization_rules}) {
                $man .= sprintf "=item * %s\n\n", $_;
            }

            $man .= "=back\n\n";

        }

        if ($native_name) {
            $man .= "=item B<Native Label>: $native_name\n\n";
        }

        $man .= "=back\n\n";

        if ($note) {
            $man .= sprintf "%s\n\n", _md_to_pod($note);
        }
    }

    if (@{$qualifiers_definition}) {

        $man .= "=head2 Qualifiers\n\n";
        $man .= "=over 2\n\n";

        foreach my $qualifier (@{$qualifiers_definition}) {

            $man .= sprintf "=item C<%s>\n\n", $qualifier->{key};

            if (my $requirement = $qualifier->{requirement}) {
                $man .= sprintf "Requirement: %s\n\n", ucfirst($requirement);
            }

            if (my $native_name = $qualifier->{native_name}) {
                $man .= sprintf "Native name: %s\n\n", $native_name;
            }

            if (my $default_value = $qualifier->{default_value}) {
                $man .= sprintf "Default value: %s\n\n", $default_value;
            }

            $man .= sprintf "%s\n\n", _md_to_pod($qualifier->{description});

        }

        $man .= "=back\n\n";

    }

    if ($repository) {

        my $use_repository         = $repository->{use_repository} ? 'Yes' : 'No';
        my $default_repository_url = $repository->{default_repository_url};

        $man .= "=head1 REPOSITORY\n\n";
        $man .= "=over\n\n";
        $man .= sprintf "=item B<Use repository>: %s\n\n",         $repository->{use_repository} ? 'Yes' : 'No';
        $man .= sprintf "=item B<Default repository URL>: %s\n\n", $repository->{default_repository_url} || '(none)';
        $man .= "=back\n\n";

        if (my $note = $repository->{note}) {
            $man .= sprintf "%s\n\n", _md_to_pod($note);
        }

    }

    if (@{$examples}) {

        $man .= "=head1 EXAMPLES\n\n";
        $man .= "=over 2\n\n";

        foreach (@{$examples}) {
            $man .= sprintf "=item * %s\n\n", $_;
        }

        $man .= "=back\n\n";

    }

    if ($note) {
        $man .= "=head1 NOTES\n\n";
        $man .= sprintf "$note\n\n";
    }

    $man .= "=head1 REFERENCES\n\n";
    $man .= "=over 2\n\n";

    $man .= sprintf "=item * %s schema ID, L<%s>\n\n", $type_name, $schema_id;

    foreach (@{$reference_urls}) {
        $man .= sprintf "=item * %s reference, L<%s>\n\n", $type_name, $_;
    }

    $man .= "=item * PURL specification, L<https://github.com/package-url/purl-spec>\n\n";
    $man .= "=item * VERS specification, L<https://github.com/package-url/vers-spec>\n\n";

    $man .= "=back\n\n";

    Pod::Text->new->parse_string_document($man, \my $output);

    exit;

}

1;

__END__

NAME
URI::PackageURL::App - URI::PackageURL (PURL) Command Line Interface

SYNOPSIS
    use URI::PackageURL::App qw(run);

    run(\@ARGV);

DESCRIPTION
URI::PackageURL::App "Command Line Interface" helper module for "purl-tool(1)".

URI::PackageURL->run(@args)
    Execute the command

cli_error($error)
    Clean error

AUTHOR
Giuseppe Di Terlizzi <https://metacpan.org/author/gdt>

COPYRIGHT AND LICENSE
Copyright © 2022-2026 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.