#!/usr/bin/env perl
# PODNAME: locale_simple_scraper
# ABSTRACT: Command line tool for finding tokens in code
our $VERSION = '0.200';


use strict;
use warnings;

use Locale::Simple::Scraper 'scrape';

print STDERR "locale_simple_scraper is deprecated, use: locale-simple scrape\n";

eval { scrape(@ARGV); 1 } or do {
    my $err = $@;
    if ( ref $err and ref $err eq 'Locale::Simple::Scraper::BadCall' ) {
        print STDERR $err->{message}, Locale::Simple::Scraper::usage();
        exit 2;
    }
    $err .= "\n" unless $err =~ /\n\z/;
    print STDERR $err;
    exit 1;
};

__END__

=pod

=encoding UTF-8

=head1 NAME

locale_simple_scraper - Command line tool for finding tokens in code

=head1 VERSION

version 0.200

=head1 SYNOPSIS

B<Deprecated:> use C<locale-simple scrape> (L<locale-simple>) instead, the
same scraper with the same options. Every call prints a deprecation notice on
STDERR; the output and the exit codes are unchanged.

  # ignoring specific regexps for the filename
  # please be aware that you must escape the . and because we use bash here you
  # must also be aware to escape the \ for escaping the .
  locale_simple_scraper --ignore \\.build --ignore some/dir

  # only use specific regexps for the filename
  locale_simple_scraper --only core --only site/something

  # different output parameter, might require more modules
  locale_simple_scraper --output perl
  locale_simple_scraper --output yaml
  locale_simple_scraper --output json

  # suppress output of line numbers
  locale_simple_scraper --no_line_numbers

  # scramble real filename with md5 (for security)
  locale_simple_scraper --md5

  # setting additional extensions for Javascript (default: js)
  locale_simple_scraper --js jjs,ajs

  # setting additional extensions for Perl (default: pl, pm, t)
  locale_simple_scraper --pl ppl,pppl

  # every one of these options can be given more than once, the lists add up
  locale_simple_scraper --pl ppl --pl pppl

  # setting additional extensions for Text::Xslate (default: tx)
  locale_simple_scraper --tx ttx,xxx

  # the same for Python (py), PHP (php), Go (go) and Rust (rs)
  locale_simple_scraper --php phtml,inc

=head1 DESCRIPTION

This tool parses all Perl, Python, JavaScript, PHP, Go and Rust sources and
Text::Xslate templates in the current directory and subdirectories to find
calls to the L<Locale::Simple> API and its siblings in the other languages.

It gives out on STDERR which files are parsed right now, while it dumps the
resulting data to the screen. By default it generates a B<.po> file, but you can
specify via I<--output> to dump B<json>, B<yaml> or a B<perl> data structure.

Be aware that we add the domain as flag in the B<.po> file. So double token
may appear which only differs through a B<#,> flag.

The options are listed by C<locale_simple_scraper --help> as well.

=head1 SEE ALSO

L<Locale::Simple>, L<Locale::Simple::Scraper>

=head1 SUPPORT

=head2 Issues

Please report bugs and feature requests at
L<https://github.com/Getty/locale-simple/issues>.

=head1 CONTRIBUTING

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

=head1 AUTHOR

Torsten Raudssus <getty@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2026 by Torsten Raudssus L<https://raudssus.de/>.

This is free software, licensed under:

  The MIT (X11) License

=cut
