package CatalystX::HelpText::Finder::TemplateToolkit::Regexp;
use Moose;
use Moose::Autobox;
use List::MoreUtils qw/ uniq /;

sub find_helptext_keys_in_fn {
    my ($self, $fn, $script) = @_;
    open(FILE, $fn) or warn "Can't open $fn\n" && return;
    my @keys = ();
    while (<FILE>) {
        if (my ($key) = m/help_text\(\s*['"](.*)['"]\s*\)/o) {
            push @keys, $key;
        }
    }
    close(FILE);
    return [ uniq @keys ];
}

1;