#!perl

our $DATE = '2015-08-06'; # DATE
our $VERSION = '0.02'; # VERSION

# NO_PERINCI_CMDLINE_SCRIPT
# FRAGMENT id=shcompgen-hint completer=1 for=mpv

use 5.010001;
use strict;
use warnings;
#use Log::Any '$log';

use Complete::Number qw(complete_int complete_float);
use Complete::Util qw(complete_array_elem combine_answers complete_file);
use Getopt::Long::Complete qw(GetOptionsWithCompletion);

die "This script is for shell completion only\n"
    unless $ENV{COMP_LINE} || $ENV{COMMAND_LINE};

my $noop = sub {};

GetOptionsWithCompletion(
    sub {
        my %args  = @_;
        my $type      = $args{type};
        my $word      = $args{word};
        if ($type eq 'arg') {
            #$log->tracef("Completing arg");
            return undef;
        } elsif ($type eq 'optval') {
            my $ospec = $args{ospec};
            my $opt   = $args{opt};
            #$log->tracef("Completing optval (opt=$opt)");
            if ($ospec eq 'ad-lavc-ac3drc=f') {
                return complete_float(word=>$word, min=>0, max=>2);
            } elsif ($ospec eq 'ad-lavc-threads=i') {
                return complete_int(word=>$word, min=>1, max=>16);
            } elsif ($ospec eq 'aid=s') {
                return combine_anwers(
                    complete_array_elem(array=>['no','auto'], word=>$word),
                    complete_int(word=>$word, min=>1, max=>8190),
                );
            } elsif ($ospec eq 'ass-hinting=s') {
                return complete_array_elem(array=>[qw/none light normal native/], word=>$word);
            } elsif ($ospec eq 'ass-line-spacing=f') {
                return complete_float(word=>$word, min=>-1000, max=>1000);
            } elsif ($ospec eq 'ass-shaper=s') {
                return complete_array_elem(array=>[qw/simple complex/], word=>$word);
            } elsif ($ospec eq 'ass-style-override=s') {
                return complete_array_elem(array=>[qw/no yes force signfs/], word=>$word);
            } elsif ($ospec eq 'ass-styles=s') {
                return complete_file(word=>$word);
            } elsif ($ospec eq 'ass-vsfilter-color-compat=s') {
                return complete_array_elem(array=>[qw/no basic full force-601/], word=>$word);
            } elsif ($ospec eq 'audio-buffer=f') {
                return complete_float(word=>$word, min=>0, max=>10);
            } elsif ($ospec eq 'audio-channels=i') {
                return complete_int(word=>$word, min=>0);
            } elsif ($ospec eq 'audio-delay=f') {
                return complete_float(word=>$word, min=>-100, max=>100);
            } elsif ($ospec eq 'audio-display=s') {
                return complete_array_elem(array=>[qw/no attachment/], word=>$word);
            } elsif ($ospec eq 'audio-file=s') {
                return complete_file(word=>$word);
            } elsif ($ospec eq 'autosync=s') {
                return combine_answers(
                    complete_array_elem(array=>[qw/no/], word=>$word),
                    complete_int(word=>$word, min=>0, max=>10000),
                );
            } elsif ($ospec eq 'blueray-angle=i') {
                return complete_int(word=>$word, min=>0, max=>999);
            } elsif ($ospec eq 'blueray-device=s') {
                return complete_file(word=>$word);
            } elsif ($ospec eq 'brightness=i') {
                return complete_int(word=>$word, min=>-100, max=>100);
            } elsif ($ospec eq 'cache=s') {
                return combine_answers(
                    complete_array_elem(array=>[qw/no auto/], word=>$word),
                    complete_int(word=>$word, min=>32, max=>2147483647),
                );
            } elsif ($ospec eq 'cache-default=s') {
                return combine_answers(
                    complete_array_elem(array=>[qw/no/], word=>$word),
                    complete_int(word=>$word, min=>32, max=>2147483647),
                );
            } elsif ($ospec eq 'cache-file=s') {
                return complete_file(word=>$word);
            } elsif ($ospec eq 'cache-file-size=i') {
                return complete_int(word=>$word, min=>0, max=>2147483647);
            } elsif ($ospec eq 'cache-initial=i') {
                return complete_int(word=>$word, min=>0, max=>2147483647);
            } elsif ($ospec eq 'cache-seek-min=i') {
                return complete_int(word=>$word, min=>0, max=>2147483647);
            }
            # UNFINISHED
        }
        return [];
    },

    'ad=s' => $noop,                    # String (default: -spdif:*)
    'ad-lavc-ac3drc=f' => $noop,        # Float (0 to 2) (default: 1.000000)
    'ad-lavc-downmix!' => $noop,        # Flag (default: yes)
    'ad-lavc-o=s' => $noop,             # Key/value list (default: )
    'ad-lavc-threads=i' => $noop,       # Integer (1 to 16) (default: 1)
    'ad-spdif-dtshd!' => $noop,         # Flag (default: no)
    'af=s' => $noop,                    # Object settings list (default: )
    'af-defaults=s' => $noop,           # Object settings list (default: )
    'aid=s' => $noop,                   # Choices: no auto (or an integer) (1 to 8190) (default: auto)
    'alang=s' => $noop,                 # String list (default: )
    'ao=s' => $noop,                    # Object settings list (default: )
    'ao-defaults=s' => $noop,           # Object settings list (default: )
    'ass-force-style=s' => $noop,       # String list (default: )
    'ass-hinting=s' => $noop,           # Choices: none light normal native (default: none)
    'ass-line-spacing=f' => $noop,      # Float (-1000 to 1000) (default: 0.000000)
    'ass-shaper=s' => $noop,            # Choices: simple complex (default: complex)
    'ass-style-override=s' => $noop,    # Choices: no yes force signfs (default: yes)
    'ass-styles=s' => $noop,            # String (default: ) [file]
    'ass-use-margins!' => $noop,        # Flag (default: no)
    'ass-vsfilter-aspect-compat!' => $noop, # Flag (default: yes)
    'ass-vsfilter-blur-compat!' => $noop, # Flag (default: yes)
    'ass-vsfilter-color-compat=s' => $noop, # Choices: no basic full force-601 (default: basic)
    'audio-buffer=f' => $noop,          # Double (0 to 10) (default: 0.200000)
    'audio-channels=i' => $noop,        # Audio channels or channel map (0 to any)
    'audio-delay=f' => $noop,           # Float (-100 to 100) (default: 0.000000)
    'audio-demuxer=s' => $noop,         # String (default: )
    'audio-display=s' => $noop,         # Choices: no attachment (default: attachment)
    'audio-file=s' => $noop,            # String list (default: ) [file]
    'audio-format=s' => $noop,          # Audio format
    'audio-samplerate=i' => $noop,      # Integer (1000 to 384000) (default: 0)
    'autofit=s' => $noop,               # Window size
    'autofit-larger=s' => $noop,        # Window size
    'autosync=s' => $noop,              # Choices: no (or an integer) (0 to 10000) (default: 0)
    'bluray-angle=i' => $noop,          # Integer (0 to 999) (default: 0)
    'bluray-device=s' => $noop,         # String (default: ) [file]
    'border!' => $noop,                 # Flag (default: yes)
    'brightness=i' => $noop,            # Integer (-100 to 100) (default: 1000)
    'cache=s' => $noop,                 # Choices: no auto (or an integer) (32 to 2147483647) (default: auto)
    'cache-default=s' => $noop,         # Choices: no (or an integer) (32 to 2147483647) (default: 25000)
    'cache-file=s' => $noop,            # String (default: ) [file]
    'cache-file-size=i' => $noop,       # Integer (0 to 2147483647) (default: 1048576)
    'cache-initial=i' => $noop,         # Integer (0 to 2147483647) (default: 0)
    'cache-pause!' => $noop,            # Flag (default: yes)
    'cache-secs=f' => $noop,            # Double (0 to any) (default: 2.000000)
    'cache-seek-min=i' => $noop,        # Integer (0 to 2147483647) (default: 500)
    'cdda-device=s' => $noop,           # String (default: )

    'cdda-overlap=i' => $noop,          # Integer (0 to 75) (default: -1)
    'cdda-paranoia=i' => $noop,         # Integer (0 to 2) (default: 0)
    'cdda-sector-size=i' => $noop,      # Integer (1 to 100) (default: 0)
    'cdda-skip!' => $noop,              # Flag (default: yes)
    'cdda-span=s' => $noop,             # Int[-Int]
    'cdda-speed=i' => $noop,            # Integer (1 to 100) (default: 0)
    'cdda-toc-bias=i' => $noop,         # Integer (default: 0)
    'cdda-toc-offset=i' => $noop,       # Integer (default: 0)
    'cdrom-device=s' => $noop,          # String (default: ) [file]
    'chapter=s' => $noop,               # Int[-Int]
    'chapter-merge-threshold=i' => $noop, # Integer (0 to 10000) (default: 100)
    'chapter-seek-threshold=f' => $noop, # Double (default: 5.000000)
    'colormatrix=s' => $noop,           # Choices: auto BT.601 BT.709 SMPTE-240M BT.2020-NCL BT.2020-CL YCgCo (default: auto)
    'colormatrix-input-range=s' => $noop, # Choices: auto limited full (default: auto)
    'colormatrix-output-range=s' => $noop, # Choices: auto limited full (default: auto)
    'colormatrix-primaries=s' => $noop, # Choices: auto BT.601-525 BT.601-625 BT.709 BT.2020 (default: auto)
    'config!' => $noop,                 # Flag (default: yes) [global] [nocfg]
    'config-dir=s' => $noop,            # String (default: ) [global] [nocfg]
    'contrast=i' => $noop,              # Integer (-100 to 100) (default: 1000)
    'cookies!' => $noop,                # Flag (default: no)
    'cookies-file=s' => $noop,          # String (default: ) [file]
    'correct-pts!' => $noop,            # Flag (default: yes)
    'cursor-autohide=s' => $noop,       # Choices: no always (or an integer) (0 to 30000) (default: 1000)
    'cursor-autohide-fs-only!' => $noop, # Flag (default: no)
    'deinterlace=s' => $noop,           # Choices: auto no yes  (default: auto)
    'demuxer=s' => $noop,               #  String (default: )
    'demuxer-lavf-allow-mimetype!' => $noop, # Flag (default: yes)
    'demuxer-lavf-analyzeduration=f' => $noop, # Float (0 to 3600) (default: 0.000000)
    'demuxer-lavf-buffersize=i' => $noop, # Integer (1 to 10485760) (default: 32768)
    'demuxer-lavf-cryptokey=s' => $noop, # String (default: )
    'demuxer-lavf-format=s' => $noop,   # String (default: )
    'demuxer-lavf-genpts-mode=s' => $noop, # Choices: lavf no (default: no)
    'demuxer-lavf-o=s' => $noop,        # Key/value list (default: )
    'demuxer-lavf-probescore=i' => $noop, # Integer (0 to 100) (default: 0)
    'demuxer-lavf-probesize=i' => $noop, # Integer (32 to 2147483647) (default: 0)
    'demuxer-mkv-subtitle-preroll!' => $noop, # Flag (default: no)
    'demuxer-rawaudio-channels=i' => $noop, # Audio channels or channel map (1 to any)
    'demuxer-rawaudio-format=s' => $noop, #       Choices: u8 s8 u16le u16be s16le u16be u24le u24be s24le s24be u32le u32be s32le s32be floatle floatbe doublele doublebe u16 s16 u24 s24 u32 s32 float double (default: s16le)
    'demuxer-rawaudio-rate=i' => $noop, #         Integer (1000 to 384000) (default: 44100)
    'demuxer-rawvideo-codec=s' => $noop, #        String (default: )
    'demuxer-rawvideo-format=s' => $noop, #       FourCC
    'demuxer-rawvideo-fps=f' => $noop, #          Float (0.001 to 1000) (default: 25.000000)
    'demuxer-rawvideo-h=i' => $noop, #            Integer (1 to 8192) (default: 720)
    'demuxer-rawvideo-mp-format=s' => $noop, #    Image format
    'demuxer-rawvideo-size=i' => $noop, #         Integer (1 to 268435456) (default: 0)
    'demuxer-rawvideo-w=i' => $noop, #            Integer (1 to 8192) (default: 1280)
    'demuxer-readahead-bytes=i' => $noop, #       Integer (0 to 419430400) (default: 0)
    'demuxer-readahead-packets=i' => $noop, #     Integer (0 to 16000) (default: 0)
    'demuxer-readahead-secs=f' => $noop, #        Double (0 to any) (default: 0.200000)
    'demuxer-thread!' => $noop, #                Flag (default: yes)
    'display-fps=f' => $noop, #                   Double (0 to any) (default: 0.000000)
    'dtshd!' => $noop, #                         Flag (default: no)
    'dump-stats=s' => $noop, #                    String (default: ) [global]
    'dvbin-card=i' => $noop, #                      Integer (1 to 4) (default: 1)
    'dvbin-file=s' => $noop, #                      String (default: )
    'dvbin-prog=s' => $noop, #                      String (default: )
    'dvbin-timeout=i' => $noop, #                   Integer (1 to 30) (default: 30)
    'dvd-angle=i' => $noop, #                       Integer (1 to 99) (default: 1)
    'dvd-device=s' => $noop, #                      String (default: ) [file]
    'dvd-speed=i' => $noop, #                       Integer (default: 0)
    'edition=s' => $noop, #                         Choices: auto (or an integer) (0 to 8190) (default: auto)
    'embeddedfonts!' => $noop, #                   Flag (default: yes)
    'end=s' => $noop, #                             Relative time or percent position
    'field-dominance=s' => $noop, #                 Choices: auto top bottom (default: auto)
    'fixed-vo!' => $noop, #                        Flag (default: yes) [global]
    'force-rgba-osd-rendering!' => $noop, #        Flag (default: no)
    'force-window!' => $noop, #                    Flag (default: no) [global]
    'force-window-position!' => $noop, #           Flag (default: no)
    'fps=f' => $noop, #                             Double (0 to any) (default: 0.000000)
    'framedrop=s' => $noop, #                       Choices: no vo decoder decoder+vo (default: vo)
    'frames=s' => $noop, #                          Choices: all (or an integer) (0 to 2147483647) (default: all)
    'fs!' => $noop, #                              Flag (default: no)
    'fs-screen=s' => $noop, #                       Choices: all current (or an integer) (0 to 32) (default: current)
    'fullscreen!' => $noop, #                      Flag (default: no)
    'gamma=i' => $noop, #                           Integer (-100 to 100) (default: 1000)
    'gapless-audio=s' => $noop, #                   Choices: no yes  weak (default: weak)
    'geometry=s' => $noop, #                        Window geometry
    'help|h' => $noop, #                               Print [global] [nocfg]
    'heartbeat-cmd=s' => $noop, #                   String (default: )
    'heartbeat-interval=f' => $noop, #              Float (0 to any) (default: 30.000000)
    'hls-bitrate=s' => $noop, #                     Choices: no min max (default: no)
    'hr-seek=s' => $noop, #                         Choices: no absolute always yes (default: absolute)
    'hr-seek-demuxer-offset=f' => $noop, #          Float (-9 to 99) (default: 0.000000)
    'hr-seek-framedrop!' => $noop, #               Flag (default: yes)
    'http-header-fields=s' => $noop, #              String list (default: )
    'hue=i' => $noop, #                             Integer (-100 to 100) (default: 1000)
    'hwdec=s' => $noop, #                           Choices: no auto vdpau vda vaapi vaapi-copy (default: no)
    'hwdec-codecs=s' => $noop, #                    String (default: h264,vc1,wmv3)
    'idle!' => $noop, #                            Flag (default: no) [global]
    'include=s' => $noop, #                         String (default: ) [file]
    'index=s' => $noop, #                           Choices: default recreate (default: default)
    'initial-audio-sync!' => $noop, #              Flag (default: yes)
    'input-ar-delay=i' => $noop, #                  Integer (default: 200) [global]
    'input-ar-rate=i' => $noop, #                   Integer (default: 40) [global]
    'input-cmdlist' => $noop, #                   Print [global] [nocfg]
    'input-conf=s' => $noop, #                      String (default: ) [global]
    'input-cursor!' => $noop, #                    Flag (default: yes) [global]
    'input-default-bindings!' => $noop, #          Flag (default: yes) [global]
    'input-doubleclick-time=i' => $noop, #          Integer (0 to 1000) (default: 300)
    'input-file=s' => $noop, #                      String (default: ) [global]
    'input-joystick!' => $noop, #                  Flag (default: no) [global]
    'input-js-dev=s' => $noop, #                    String (default: ) [global]
    'input-key-fifo-size=i' => $noop, #             Integer (2 to 65000) (default: 7) [global]
    'input-keylist' => $noop, #                   Print [global] [nocfg]
    'input-lirc!' => $noop, #                      Flag (default: yes) [global]
    'input-lirc-conf=s' => $noop, #                 String (default: ) [global]
    'input-right-alt-gr!' => $noop, #              Flag (default: yes) [global]
    'input-terminal!' => $noop, #                  Flag (default: yes) [global]
    'input-test!' => $noop, #                      Flag (default: no) [global]
    'input-x11-keyboard!' => $noop, #              Flag (default: yes) [global]
    'keep-open!' => $noop, #                       Flag (default: no)
    'keepaspect!' => $noop, #                      Flag (default: yes)
    'leak-report!' => $noop, #                    Flag [global] [nocfg]
    'length=s' => $noop, #                          Relative time or percent position
    'list-options!' => $noop, #                    Flag [nocfg]
    'list-properties' => $noop, #                 Print [global] [nocfg]
    'list-protocols' => $noop, #                  Print [global] [nocfg]
    'load-scripts!' => $noop, #                    Flag (default: yes) [global]
    'load-unsafe-playlists!' => $noop, #           Flag (default: no)
    'loop=s' => $noop, #                            Choices: no 1 inf (or an integer) (2 to 10000) (default: no) [global]
    'loop-file=s' => $noop, #                       Choices: yes  no inf (or an integer) (0 to 10000) (default: no)
    'lua=s' => $noop, #                             String list (default: ) [global] [file]
    'lua-opts=s' => $noop, #                        Key/value list (default: ) [global]
    'mc=f' => $noop, #                              Float (0 to 100) (default: -1.000000)
    'media-title=s' => $noop, #                     String (default: )
    'merge-files!' => $noop, #                     Flag (default: no)
    'mf-fps=f' => $noop, #                          Double (default: 1.000000)
    'mf-type=s' => $noop, #                         String (default: )
    'mkv-subtitle-preroll!' => $noop, #            Flag (default: no)
    'monitoraspect=f' => $noop, #                   Float (0 to 9) (default: 0.000000)
    'monitorpixelaspect!' => $noop, #              Float (0.2 to 9) (default: 1.000000)
    'msg-color!' => $noop, #                       Flag (default: yes) [global]
    'msg-level=s' => $noop, #                       Output verbosity levels (default: ) [global]
    'msg-module!' => $noop, #                      Flag (default: no) [global]
    'msg-time!' => $noop, #                        Flag (default: no) [global]
    'mute=s' => $noop, #                            Choices: auto no yes  (default: auto)
    'native-keyrepeat!' => $noop, #                Flag (default: no)
    'no-audio' => $noop, #                      Flag
    'no-sub' => $noop, #                         Flag
    'no-video' => $noop, #                       Flag
    'no-video-aspect' => $noop, #                Flag
    'o=s' => $noop, #                              String (default: ) [global] [nocfg]
    'oac=s' => $noop, #                            String (default: ) [global]
    'oacopts=s' => $noop, #                       String list (default: ) [global]
    'oafirst!' => $noop, #                        Flag (default: no) [global]
    'oaoffset=f' => $noop, #                       Float (-1000000 to 1000000) (default: 0.000000) [global]
    'oautofps!' => $noop, #                       Flag (default: no) [global]
    'ocopyts!' => $noop, #                        Flag (default: no) [global]
    'of=s' => $noop, #                             String (default: ) [global]
    'ofopts=s' => $noop, #                        String list (default: ) [global]
    'ofps=f' => $noop, #                           Float (0 to 1000000) (default: 0.000000) [global]
    'oharddup!' => $noop, #                       Flag (default: no) [global]
    'omaxfps=f' => $noop, #                        Float (0 to 1000000) (default: 0.000000) [global]
    'ometadata!' => $noop, #                      Flag (default: yes) [global]
    'oneverdrop!' => $noop, #                     Flag (default: no) [global]
    'ontop!' => $noop, #                          Flag (default: no)
    'orawts!' => $noop, #                         Flag (default: no) [global]
    'ordered-chapters!' => $noop, #               Flag (default: yes)
    'ordered-chapters-files=s' => $noop, #         String (default: ) [file]
    'osc!' => $noop, #                            Flag (default: yes) [global]
    'osd-back-color=s' => $noop, #                 Color
    'osd-bar!' => $noop, #                        Flag (default: yes)
    'osd-bar-align-x=f' => $noop, #                Float (-1 to 1) (default: 0.000000)
    'osd-bar-align-y=f' => $noop, #                Float (-1 to 1) (default: 0.500000)
    'osd-bar-h=f' => $noop, #                      Float (0.1 to 50) (default: 3.125000)
    'osd-bar-w=f' => $noop, #                      Float (1 to 100) (default: 75.000000)
    'osd-blur=f' => $noop, #                       Float (0 to 20) (default: 0.000000)
    'osd-border-color=s' => $noop, #               Color
    'osd-border-size=f' => $noop, #                Float (0 to 10) (default: 2.500000)
    'osd-color=s' => $noop, #                      Color
    'osd-duration=i' => $noop, #                   Integer (0 to 3600000) (default: 1000)
    'osd-font=s' => $noop, #                       String (default: sans-serif)
    'osd-font-size=f' => $noop, #                  Float (1 to 9000) (default: 45.000000)
    'osd-fractions!' => $noop, #                  Flag (default: no)
    'osd-level=s' => $noop, #                      Choices: 0 1 2 3 (default: 1)
    'osd-margin-x=i' => $noop, #                   Integer (0 to 300) (default: 25)
    'osd-margin-y=i' => $noop, #                   Integer (0 to 600) (default: 10)
    'osd-msg1=s' => $noop, #                       String (default: )
    'osd-msg2=s' => $noop, #                       String (default: )
    'osd-msg3=s' => $noop, #                       String (default: )
    'osd-playing-msg=s' => $noop, #                String (default: )
    'osd-scale=f' => $noop, #                      Float (0 to 100) (default: 1.000000)
    'osd-scale-by-window=f' => $noop, #            Flag (default: yes)
    'osd-shadow-color=s' => $noop, #               Color
    'osd-shadow-offset=f' => $noop, #              Float (0 to 10) (default: 0.000000)
    'osd-spacing=f' => $noop, #                    Float (-10 to 10) (default: 0.000000)
    'osd-status-msg=s' => $noop, #                 String (default: )
    'ovc=s' => $noop, #                            String (default: ) [global]
    'ovcopts=s' => $noop, #                       String list (default: ) [global]
    'ovfirst!' => $noop, #                        Flag (default: no) [global]
    'ovoffset=f' => $noop, #                       Float (-1000000 to 1000000) (default: 0.000000) [global]
    'panscan=f' => $noop, #                        Float (0 to 1) (default: 0.000000)
    'pause=f' => $noop, #                          Flag (default: no)
    'playlist=s' => $noop, #                       String (1 to any) (default: ) [nocfg] [file]
    'profile=s' => $noop, #                        String list (default: )
    'pts-association-mode=s' => $noop, #           Choices: auto decoder sort (default: decoder)
    'pvr-abitrate=i' => $noop, #                   Integer (default: 0)
    'pvr-alayer=i' => $noop, #                     Integer (default: 0)
    'pvr-amode=s' => $noop, #                      String (default: )
    'pvr-arate=i' => $noop, #                      Integer (default: 0)
    'pvr-aspect=i' => $noop, #                     Integer (default: 0)
    'pvr-fmt=s' => $noop, #                        String (default: )
    'pvr-vbitrate=i' => $noop, #                   Integer (default: 0)
    'pvr-vmode=s' => $noop, #                      String (default: )
    'pvr-vpeak=i' => $noop, #                      Integer (default: 0)
    'quiet!' => $noop, #                          Flag (default: no) [global]
    'quvi-fetch-subtitles!' => $noop, #           Flag (default: no)
    'quvi-format=s' => $noop, #                    String (default: )
    'really-quiet' => $noop, #                   Flag [global]
    'referrer=s' => $noop, #                       String (default: )
    'reset-on-next-file=s' => $noop, #             String list (default: ) [global]
    'resume-playback!' => $noop, #                Flag (default: yes)
    'rtsp-transport=s' => $noop, #                 Choices: lavf udp tcp http (default: tcp)
    'saturation=i' => $noop, #                     Integer (-100 to 100) (default: 1000)
    'save-position-on-quit!' => $noop, #          Flag (default: no)
    'screen=s' => $noop, #                         Choices: default (or an integer) (0 to 32) (default: default)
    'screenshot-format=s' => $noop, #              String (default: jpg)
    'screenshot-jpeg-baseline!' => $noop, #       Flag (default: yes)
    'screenshot-jpeg-dpi=i' => $noop, #            Integer (1 to 99999) (default: 72)
    'screenshot-jpeg-optimize=i' => $noop, #       Integer (0 to 100) (default: 100)
    'screenshot-jpeg-progressive!' => $noop, #    Flag (default: no)
    'screenshot-jpeg-quality=i' => $noop, #        Integer (0 to 100) (default: 90)
    'screenshot-jpeg-smooth=i' => $noop, #         Integer (0 to 100) (default: 0)
    'screenshot-png-compression=i' => $noop, #     Integer (0 to 9) (default: 7)
    'screenshot-png-filter=i' => $noop, #          Integer (0 to 5) (default: 5)
    'screenshot-template=s' => $noop, #            String (default: )
    'secondary-sid=s' => $noop, #                  Choices: no auto (or an integer) (1 to 8190) (default: no)
    'show-profile=s' => $noop, #                   String (default: ) [nocfg]
    'shuffle!' => $noop, #                        Flag (default: no) [global] [nocfg]
    'sid=s' => $noop, #                            Choices: no auto (or an integer) (1 to 8190) (default: auto)
    'slang=s' => $noop, #                          String list (default: )
    'slave-broken!' => $noop, #                   Flag (default: no) [global]
    'softvol=s' => $noop, #                        Choices: no yes auto (default: auto)
    'softvol-max' => $noop, #                    Float (10 to 10000) (default: 200.000000)
    'speed=f' => $noop, #                          Double (0.01 to 100) (default: 1.000000)
    'sstep=f' => $noop, #                          Double (0 to any) (default: 0.000000)
    'start=s' => $noop, #                          Relative time or percent position
    'stop-screensaver!' => $noop, #               Flag (default: yes)
    'stream-capture=s' => $noop, #                 String (default: ) [file]
    'stream-dump=s' => $noop, #                    String (default: ) [file]
    'stream-lavf-o=s' => $noop, #                  Key/value list (default: )
    'stretch-dvd-subs!' => $noop, #               Flag (default: no)
    'sub-ass!' => $noop, #                        Flag (default: yes)
    'sub-auto=s' => $noop, #                       Choices: no exact fuzzy all (default: exact)
    'sub-clear-on-seek!' => $noop, #              Flag (default: no)
    'sub-codepage=s' => $noop, #                   String (default: auto)
    'sub-delay=f' => $noop, #                      Float (default: 0.000000)
    'sub-demuxer=s' => $noop, #                    String (default: )
    'sub-file=f' => $noop, #                       String list (default: ) [file]
    'sub-fix-timing!' => $noop, #                 Flag (default: yes)
    'sub-forced-only!' => $noop, #                Flag (default: no)
    'sub-fps=f' => $noop, #                        Float (default: 0.000000)
    'sub-gauss=f' => $noop, #                      Float (0 to 3) (default: 0.000000)
    'sub-gray!' => $noop, #                       Flag (default: no)
    'sub-paths=s' => $noop, #                      String list (default: )
    'sub-pos=i' => $noop, #                        Integer (0 to 100) (default: 100)
    'sub-scale=f' => $noop, #                      Float (0 to 100) (default: 1.000000)
    'sub-scale-with-window!' => $noop, #          Flag (default: no)
    'sub-speed=f' => $noop, #                      Float (default: 1.000000)
    'sub-text-back-color=s' => $noop, #            Color
    'sub-text-blur=f' => $noop, #                  Float (0 to 20) (default: 0.000000)
    'sub-text-border-color=s' => $noop, #          Color
    'sub-text-border-size=f' => $noop, #           Float (0 to 10) (default: 2.500000)
    'sub-text-color=s' => $noop, #                 Color
    'sub-text-font=s' => $noop, #                  String (default: sans-serif)
    'sub-text-font-size=f' => $noop, #             Float (1 to 9000) (default: 45.000000)
    'sub-text-margin-x=i' => $noop, #              Integer (0 to 300) (default: 25)
    'sub-text-margin-y=i' => $noop, #              Integer (0 to 600) (default: 10)
    'sub-text-shadow-color=s' => $noop, #          Color
    'sub-text-shadow-offset=f' => $noop, #         Float (0 to 10) (default: 0.000000)
    'sub-text-spacing=f' => $noop, #               Float (-10 to 10) (default: 0.000000)
    'sub-visibility!' => $noop, #                 Flag (default: yes)
    'sws-cgb=f' => $noop, #                        Float (0 to 100) (default: 0.000000)
    'sws-chs=i' => $noop, #                        Integer (default: 0)
    'sws-cs=f' => $noop, #                         Float (-100 to 100) (default: 0.000000)
    'sws-cvs=i' => $noop, #                        Integer (default: 0)
    'sws-lgb=f' => $noop, #                        Float (0 to 100) (default: 0.000000)
    'sws-ls=f' => $noop, #                         Float (-100 to 100) (default: 0.000000)
    'sws-scaler=s' => $noop, #                     Choices: fast-bilinear bilinear bicubic x point area bicublin gauss sinc lanczos spline (default: bicubic)
    'term-osd=s' => $noop, #                       Choices: force auto no (default: auto)
    'term-osd-bar!' => $noop, #                   Flag (default: no)
    'term-osd-bar-chars=s' => $noop, #             String (default: [-+-])
    'term-playing-msg=s' => $noop, #               String (default: )
    'term-status-msg=s' => $noop, #                String (default: )
    'terminal!' => $noop, #                       Flag (default: yes) [global]
    'title=s' => $noop, #                          String (default: mpv - ${media-title})
    'tls-ca-file=s' => $noop, #                    String (default: ) [file]
    'tls-verify!' => $noop, #                     Flag (default: no)
    'tv-adevice=s' => $noop, #                     String (default: )
    'tv-alsa!' => $noop, #                        Flag (default: no)
    'tv-amode=i' => $noop, #                       Integer (0 to 3) (default: -1)
    'tv-audio!' => $noop, #                       Flag (default: yes)
    'tv-audioid=i' => $noop, #                     Integer (0 to 9) (default: 0)
    'tv-audiorate=i' => $noop, #                   Integer (default: 44100)
    'tv-automute=i' => $noop, #                    Integer (0 to 255) (default: 0)
    'tv-balance=i' => $noop, #                     Integer (0 to 65535) (default: -1)
    'tv-bass=i' => $noop, #                        Integer (0 to 65535) (default: -1)
    'tv-brightness=i' => $noop, #                  Integer (-100 to 100) (default: 0)
    'tv-buffersize=i' => $noop, #                  Integer (16 to 1024) (default: -1)
    'tv-chanlist=s' => $noop, #                    String (default: europe-east)
    'tv-channel=s' => $noop, #                     String (default: )
    'tv-channels=s' => $noop, #                    String list (default: )
    'tv-contrast=i' => $noop, #                    Integer (-100 to 100) (default: 0)
    'tv-decimation=i' => $noop, #                  Integer (1 to 4) (default: 2)
    'tv-device=s' => $noop, #                      String (default: )
    'tv-driver=s' => $noop, #                      String (default: )
    'tv-forceaudio!' => $noop, #                  Flag (default: no)
    'tv-forcechan=i' => $noop, #                   Integer (1 to 2) (default: -1)
    'tv-fps=f' => $noop, #                         Float (default: -1.000000)
    'tv-freq=s' => $noop, #                        String (default: )
    'tv-gain=i' => $noop, #                        Integer (-1 to 100) (default: -1)
    'tv-height=i' => $noop, #                      Integer (0 to 4096) (default: -1)
    'tv-hue=i' => $noop, #                         Integer (-100 to 100) (default: 0)
    'tv-immediatemode!' => $noop, #               Flag (default: yes)
    'tv-input=i' => $noop, #                       Integer (default: 0)
    'tv-mjpeg!' => $noop, #                       Flag (default: no)
    'tv-norm=s' => $noop, #                        String (default: pal)
    'tv-normid=i' => $noop, #                      Integer (default: -1)
    'tv-outfmt=s' => $noop, #                      FourCC
    'tv-quality=i' => $noop, #                     Integer (0 to 100) (default: 90)
    'tv-saturation=i' => $noop, #                  Integer (-100 to 100) (default: 0)
    'tv-scan-autostart!' => $noop, #              Flag (default: no)
    'tv-scan-period=f' => $noop, #                 Float (0.1 to 2) (default: 0.500000)
    'tv-scan-threshold=i' => $noop, #              Integer (1 to 100) (default: 50)
    'tv-treble=i' => $noop, #                      Integer (0 to 65535) (default: -1)
    'tv-volume=i' => $noop, #                      Integer (0 to 65535) (default: -1)
    'tv-width=i' => $noop, #                       Integer (0 to 4096) (default: -1)
    'untimed!' => $noop, #                        Flag (default: no)
    'use-filedir-conf!' => $noop, #               Flag (default: no) [global]
    'user-agent=s' => $noop, #                     String (default: mpv 0.6.2)
    'verbose|v' => $noop, #                              Flag [global] [nocfg]
    'version|V' => $noop, #                              Print [global] [nocfg]
    'vd=s' => $noop, #                             String (default: )
    'vd-lavc-bitexact!' => $noop, #               Flag (default: no)
    'vd-lavc-check-hw-profile!' => $noop, #       Flag (default: yes)
    'vd-lavc-fast!' => $noop, #                   Flag (default: no)
    'vd-lavc-framedrop=s' => $noop, #              Choices: none default nonref bidir nonkey all (default: nonref)
    'vd-lavc-o=s' => $noop, #                      Key/value list (default: )
    'vd-lavc-show-all!' => $noop, #               Flag (default: no)
    'vd-lavc-skipframe=s' => $noop, #              Choices: none default nonref bidir nonkey all (default: default)
    'vd-lavc-skipidct=s' => $noop, #               Choices: none default nonref bidir nonkey all (default: default)
    'vd-lavc-skiploopfilter=s' => $noop, #         Choices: none default nonref bidir nonkey all (default: default)
    'vd-lavc-threads=i' => $noop, #                Integer (0 to 16) (default: 0)
    'vf=s' => $noop, #                            Object settings list (default: )
    'vf-defaults=s' => $noop, #                    Object settings list (default: )
    'vid=s' => $noop, #                            Choices: no auto (or an integer) (1 to 8190) (default: auto)
    'video-align-x=f' => $noop, #                  Float (-1 to 1) (default: 0.000000)
    'video-align-y=f' => $noop, #                  Float (-1 to 1) (default: 0.000000)
    'video-aspect=f' => $noop, #                   Float (-1 to 10) (default: -1.000000)
    'video-pan-x=f' => $noop, #                    Float (-3 to 3) (default: 0.000000)
    'video-pan-y=f' => $noop, #                    Float (-3 to 3) (default: 0.000000)
    'video-rotate=s' => $noop, #                   Choices: no (or an integer) (0 to 359) (default: 0)
    'video-stereo-mode=s' => $noop, #              Stereo 3D mode (default: mono)
    'video-unscaled!' => $noop, #                 Flag (default: no)
    'video-zoom=f' => $noop, #                     Float (-20 to 20) (default: 0.000000)
    'vo=s' => $noop, #                             Object settings list (default: )
    'vo-defaults=s' => $noop, #                    Object settings list (default: )
    'volume=f' => $noop, #                         Float (-1 to 100) (default: -1.000000)
    'volume-restore-data=s' => $noop, #            String (default: )
    'wid=i' => $noop, #                            Integer64 (default: -1) [global]
    'window-dragging!' => $noop, #                Flag (default: yes) [global]
    'write-filename-in-watch-later-config!' => $noop, # Flag (default: no)
    'x11-name=s' => $noop, #                       String (default: )
    'x11-netwm!' => $noop, #                      Flag (default: yes)

 # UNSUPPORTED: --{                              Flag [nocfg]
 # UNSUPPORTED: --}                              Flag [nocfg]
);

# ABSTRACT: Shell completer for mpv
# PODNAME: _mpv

__END__

=pod

=encoding UTF-8

=head1 NAME

_mpv - Shell completer for mpv

=head1 VERSION

This document describes version 0.02 of _mpv (from Perl distribution App-ShellCompleter-mpv), released on 2015-08-06.

=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 _mpv mpv

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

Now L<mpv> has bash completion:

 % mpv --shu<tab>

Last updated for L<mpv> version B<0.6.2>.

=head1 COMPLETION

This script has shell tab completion capability with support for several
shells.

=head2 bash

To activate bash completion for this script, put:

 complete -C _mpv _mpv

in your bash startup (e.g. C<~/.bashrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.

It is recommended, however, that you install L<shcompgen> which allows you to
activate completion scripts for several kinds of scripts on multiple shells.
Some CPAN distributions (those that are built with
L<Dist::Zilla::Plugin::GenShellCompletion>) will even automatically enable shell
completion for their included scripts (using C<shcompgen>) at installation time,
so you can immadiately have tab completion.

=head2 tcsh

To activate tcsh completion for this script, put:

 complete _mpv 'p/*/`_mpv`/'

in your tcsh startup (e.g. C<~/.tcshrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.

It is also recommended to install C<shcompgen> (see above).

=head2 other shells

For fish and zsh, install C<shcompgen> as described above.

=head1 HOMEPAGE

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

=head1 SOURCE

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

=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-mpv>

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.

=head1 AUTHOR

perlancar <perlancar@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by 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.

=cut
