#!/usr/bin/env perl

# PODNAME: bundit
# ABSTRACT: CLI client for German Federal Government APIs (Italian)

use strict;
use warnings;
use lib 'lib';

binmode(STDOUT, ':encoding(UTF-8)');
binmode(STDERR, ':encoding(UTF-8)');

# Map CLI aliases to Cmd package names
my %aliases = (
    'pegel-online' => 'pegel',
    'pegel_online' => 'pegel',
    'eco-visio' => 'ecovisio',
    'eco_visio' => 'ecovisio',
);

for my $i (0 .. $#ARGV) {
    next if $ARGV[$i] =~ /^-/;
    if (exists $aliases{lc $ARGV[$i]}) {
        $ARGV[$i] = $aliases{lc $ARGV[$i]};
        last;
    }
}

$ENV{WWW_BUND_LANG} //= 'it';

use WWW::Bund::CLI;

WWW::Bund::CLI->new_with_cmd;

__END__

=pod

=encoding UTF-8

=head1 NAME

bundit - CLI client for German Federal Government APIs (Italian)

=head1 VERSION

version 0.002

=head1 SYNOPSIS

  # Elenco di tutte le API disponibili
  bundit list

  # Aiuto per un'API specifica
  bundit info autobahn
  bundit autobahn

  # Chiamare endpoint API
  bundit autobahn roads
  bundit pegel stations
  bundit tagesschau search Ucraina

  # Cambiare formato di output
  bundit -o json autobahn roads

=head1 DESCRIPTION

B<bundit> è la variante italiana del client da riga di comando B<bund>
per le API del governo federale tedesco (bund.dev). Per impostazione predefinita
visualizza in italiano (C<lang=it>) fornendo accesso alle stesse 16 API pubbliche.

Per la documentazione completa, vedere C<bund --help> o C<perldoc bund>.

=head1 OPTIONS

=over 4

=item B<-o, --output> I<formato>

Formato di output: C<template> (predefinito), C<json>, C<yaml>

=item B<--lang> I<lingua>

Cambiare lingua: C<it> (predefinito per bundit), C<de>, C<en>, C<fr>, C<es>, C<nl>, C<pl>

=item B<-h, --help>

Mostrare aiuto

=back

=head1 SEE ALSO

L<bund>, L<WWW::Bund>, L<https://bund.dev>

=head1 SUPPORT

=head2 Issues

Please report bugs and feature requests on GitHub at
L<https://github.com/Getty/p5-www-bund/issues>.

=head1 CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

=head1 AUTHOR

Torsten Raudssus <torsten@raudssus.de>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut
