#!perl

# NO_PERINCI_CMDLINE_SCRIPT
# FRAGMENT id=shcompgen-hint completer=1 for=youtube-dl

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

use CLI::Meta::YoutubeDl;
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-YoutubeDl'; # DIST
our $VERSION = '0.123'; # VERSION

my $meta = $CLI::Meta::YoutubeDl::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 youtube-dl
# PODNAME: _youtube-dl

__END__

=pod

=encoding UTF-8

=head1 NAME

_youtube-dl - Shell completer for youtube-dl

=head1 VERSION

This document describes version 0.123 of _youtube-dl (from Perl distribution App-ShellCompleter-YoutubeDl), 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 _youtube-dl youtube-dl

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

Now L<youtube-dl> has bash completion:

 % youtube-dl --no-pl<tab>
 % youtube-dl --external-downloader c<tab>

=head1 HOMEPAGE

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

=head1 SOURCE

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

=head1 SEE ALSO

L<_yt-dlp> script from L<App::ShellCompleter::YtDlp>

=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, 2020, 2019, 2017, 2016, 2015 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-YoutubeDl>

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