#!perl

# NO_PERINCI_CMDLINE_SCRIPT
# FRAGMENT id=shcompgen-hint completer=1 for=yt-dlp

use 5.010001;
use strict;
use warnings;
use Log::ger;

use CLI::Meta::YtDlp;
use Getopt::Long::Complete; # just so we can be detected as Getopt::Long script
use ShellCompleter::Util qw(run_shell_completer_for_getopt_long_app);

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2021-09-07'; # DATE
our $DIST = 'App-ShellCompleter-YtDlp'; # DIST
our $VERSION = '0.001'; # VERSION

my $meta = $CLI::Meta::YtDlp::META;
my $opts = $meta->{opts};

binmode(STDOUT, ":encoding(utf8)");
run_shell_completer_for_getopt_long_app(
    map { $_ => (defined $opts->{$_} && defined $opts->{$_}{completion} ? $opts->{$_}{completion} : undef) } keys %$opts,
);

# ABSTRACT: Shell completer for yt-dlp
# PODNAME: _yt-dlp

__END__

=pod

=encoding UTF-8

=head1 NAME

_yt-dlp - Shell completer for yt-dlp

=head1 VERSION

This document describes version 0.001 of _yt-dlp (from Perl distribution App-ShellCompleter-YtDlp), released on 2021-09-07.

=head1 SYNOPSIS

To install, install the CPAN distribution this command comes in with, and then
in your bash (and/or bash startup file):

 complete -C _yt-dlp yt-dlp

or, you can use L<shcompgen> to do that for you automatically.

Now L<yt-dlp> has bash completion:

 % yt-dlp --no-pl<tab>
 % yt-dlp --external-downloader c<tab>

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-ShellCompleter-YtDlp>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-ShellCompleter-YtDlp>.

=head1 SEE ALSO

L<_youtube-dl> script from L<App::ShellCompleter::YoutubeDl>

=head1 AUTHOR

perlancar <perlancar@cpan.org>

=head1 CONTRIBUTING


To contribute, you can send patches by email/via RT, or send pull requests on
GitHub.

Most of the time, you don't need to build the distribution yourself. You can
simply modify the code, then test via:

 % prove -l

If you want to build the distribution (e.g. to try to install it locally on your
system), you can install L<Dist::Zilla>,
L<Dist::Zilla::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
Dist::Zilla plugin and/or Pod::Weaver::Plugin. Any additional steps required
beyond that are considered a bug and can be reported to me.

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by perlancar <perlancar@cpan.org>.

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

=head1 BUGS

Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=App-ShellCompleter-YtDlp>

When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.

=cut
