#!/usr/bin/env perl

# PODNAME: bundes
# ABSTRACT: CLI client for German Federal Government APIs (Spanish)

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} //= 'es';

use WWW::Bund::CLI;

WWW::Bund::CLI->new_with_cmd;

__END__

=pod

=encoding UTF-8

=head1 NAME

bundes - CLI client for German Federal Government APIs (Spanish)

=head1 VERSION

version 0.001

=head1 SYNOPSIS

  # Lista de todas las APIs disponibles
  bundes list

  # Ayuda para una API específica
  bundes info autobahn
  bundes autobahn

  # Llamar endpoints de API
  bundes autobahn roads
  bundes pegel stations
  bundes tagesschau search Ucrania

  # Cambiar formato de salida
  bundes -o json autobahn roads

=head1 DESCRIPTION

B<bundes> es la variante en español del cliente de línea de comandos B<bund>
para las API del gobierno federal alemán (bund.dev). Por defecto muestra en
español (C<lang=es>) mientras proporciona acceso a las mismas 16 API públicas.

Para documentación completa, ver C<bund --help> o C<perldoc bund>.

=head1 OPTIONS

=over 4

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

Formato de salida: C<template> (predeterminado), C<json>, C<yaml>

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

Cambiar idioma: C<es> (predeterminado para bundes), C<de>, C<en>, C<fr>, C<it>, C<nl>, C<pl>

=item B<-h, --help>

Mostrar ayuda

=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
