#compdef libex-core
# zsh completion for libex-core, generated from the command definitions, do not edit by hand

_libex-core() {
    local curcontext="$curcontext" state line
    typeset -A opt_args

    _arguments -C \
        '(- *)'{-h,--help}'[show this help message and exit]' \
        '(- *)--version[show the version number and exit]' \
        {-q,--quiet}'[print only the final error line]' \
        {-v,--verbose}'[more detail on standard error, repeat as -vv for debug output with tracebacks]' \
        '1: :->command' \
        '*:: :->args'

    case $state in
        command)
            local -a commands
            commands=(
                'book:look up books and chapters'
                'series:look up a series'
                'author:look up an author'
                'search:search the catalog'
                'quick-search:search by keywords through suggestions'
                'abs:search in the Audiobookshelf provider shape'
                'narrator:look up books by narrator'
                'releases:look up new and upcoming releases'
                'db:set up the local store and read what it holds'
                'completion:print a shell completion script'
                'config:show how requests would leave this machine'
            )
            _describe -t commands 'libex-core command' commands
            ;;
        args)
            case ${line[1]} in
                book)
                    case ${line[2]} in
                        get)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(get)' \
                                '2:ASIN:'
                            ;;
                        bulk)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--file[read more ASINs from this file, or from standard input when it is -]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '--language[Filter by language - exact match]' \
                                '--book-format[Filter by book format - e.g. unabridged]' \
                                '--explicit[Filter by explicit]:explicit:(true false)' \
                                '--whisper-sync[Filter by Whispersync availability]:whisper-sync:(true false)' \
                                '--has-pdf[Filter by PDF companion availability]:has-pdf:(true false)' \
                                '--is-vvab[Filter by VVAB - virtual voice audiobook status]:is-vvab:(true false)' \
                                '--plan-name[Filter by Audible plan name - e.g. US Minerva]' \
                                '--rating-better-than[Minimum rating]' \
                                '--rating-worse-than[Maximum rating]' \
                                '--longer-than[Minimum length in minutes]' \
                                '--shorter-than[Maximum length in minutes]' \
                                '--genre[Filter by genre or tag name - partial match, e.g. fantasy]' \
                                '--sort[sort the books by this field, default is the order they were found in]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '1:command:(bulk)' \
                                '2:ASIN:'
                            ;;
                        chapters)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(chapters)' \
                                '2:ASIN:'
                            ;;
                        sku)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '1:command:(sku)' \
                                '2:SKU:'
                            ;;
                        *)
                            _arguments \
                                '1:command:(get bulk chapters sku)'
                            ;;
                    esac
                    ;;
                series)
                    case ${line[2]} in
                        get)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(get)' \
                                '2:ASIN:'
                            ;;
                        books)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '--language[Filter by language - exact match]' \
                                '--book-format[Filter by book format - e.g. unabridged]' \
                                '--explicit[Filter by explicit]:explicit:(true false)' \
                                '--whisper-sync[Filter by Whispersync availability]:whisper-sync:(true false)' \
                                '--has-pdf[Filter by PDF companion availability]:has-pdf:(true false)' \
                                '--is-vvab[Filter by VVAB - virtual voice audiobook status]:is-vvab:(true false)' \
                                '--plan-name[Filter by Audible plan name - e.g. US Minerva]' \
                                '--rating-better-than[Minimum rating]' \
                                '--rating-worse-than[Maximum rating]' \
                                '--longer-than[Minimum length in minutes]' \
                                '--shorter-than[Maximum length in minutes]' \
                                '--genre[Filter by genre or tag name - partial match, e.g. fantasy]' \
                                '--sort[sort the books by this field, default is the order they were found in]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '1:command:(books)' \
                                '2:ASIN:'
                            ;;
                        search)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(search)' \
                                '2:NAME:'
                            ;;
                        *)
                            _arguments \
                                '1:command:(get books search)'
                            ;;
                    esac
                    ;;
                author)
                    case ${line[2]} in
                        get)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(get)' \
                                '2:ASIN:'
                            ;;
                        search)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(search)' \
                                '2:NAME:'
                            ;;
                        books)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '--language[Filter by language - exact match]' \
                                '--book-format[Filter by book format - e.g. unabridged]' \
                                '--explicit[Filter by explicit]:explicit:(true false)' \
                                '--whisper-sync[Filter by Whispersync availability]:whisper-sync:(true false)' \
                                '--has-pdf[Filter by PDF companion availability]:has-pdf:(true false)' \
                                '--is-vvab[Filter by VVAB - virtual voice audiobook status]:is-vvab:(true false)' \
                                '--plan-name[Filter by Audible plan name - e.g. US Minerva]' \
                                '--rating-better-than[Minimum rating]' \
                                '--rating-worse-than[Maximum rating]' \
                                '--longer-than[Minimum length in minutes]' \
                                '--shorter-than[Maximum length in minutes]' \
                                '--genre[Filter by genre or tag name - partial match, e.g. fantasy]' \
                                '--sort[sort the books by this field, default is the order they were found in]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '1:command:(books)' \
                                '2:ASIN:'
                            ;;
                        books-by-name)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '--language[Filter by language - exact match]' \
                                '--book-format[Filter by book format - e.g. unabridged]' \
                                '--explicit[Filter by explicit]:explicit:(true false)' \
                                '--whisper-sync[Filter by Whispersync availability]:whisper-sync:(true false)' \
                                '--has-pdf[Filter by PDF companion availability]:has-pdf:(true false)' \
                                '--is-vvab[Filter by VVAB - virtual voice audiobook status]:is-vvab:(true false)' \
                                '--plan-name[Filter by Audible plan name - e.g. US Minerva]' \
                                '--rating-better-than[Minimum rating]' \
                                '--rating-worse-than[Maximum rating]' \
                                '--longer-than[Minimum length in minutes]' \
                                '--shorter-than[Maximum length in minutes]' \
                                '--genre[Filter by genre or tag name - partial match, e.g. fantasy]' \
                                '--sort[sort the books by this field, default is the order they were found in]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '1:command:(books-by-name)' \
                                '2:NAME:'
                            ;;
                        *)
                            _arguments \
                                '1:command:(get search books books-by-name)'
                            ;;
                    esac
                    ;;
                search)
                    _arguments \
                        '(- *)'{-h,--help}'[show this help message and exit]' \
                        '--title[words in the title]' \
                        '--author[name of the author]' \
                        '--narrator[name of the narrator]' \
                        '--publisher[name of the publisher]' \
                        '--keywords[keywords to match anywhere]' \
                        '--query[stands in for the title when none is given]' \
                        '--sort-by[the sort order, using the name Audible gives it]' \
                        '--limit[results per page, 1 to 50, default 10]' \
                        '--page[page of results to return, counting from 0 to 9, default 0]' \
                        '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)'
                    ;;
                quick-search)
                    _arguments \
                        '(- *)'{-h,--help}'[show this help message and exit]' \
                        '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                        '1:KEYWORDS:'
                    ;;
                abs)
                    case ${line[2]} in
                        search)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--title[words in the title]' \
                                '--query[stands in for the title]' \
                                '--author[name of the author]' \
                                '--keywords[keywords to match anywhere]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(search)'
                            ;;
                        quick-search)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--keywords[the words to search for]' \
                                '--query[the words to search for when no keywords are given]' \
                                '--title[the words to search for when neither is given]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(quick-search)'
                            ;;
                        *)
                            _arguments \
                                '1:command:(search quick-search)'
                            ;;
                    esac
                    ;;
                narrator)
                    case ${line[2]} in
                        books)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--limit[results per page, 1 to 50, default 10]' \
                                '--page[page of results to return, counting from 0 to 9, default 0]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(books)' \
                                '2:NAME:'
                            ;;
                        *)
                            _arguments \
                                '1:command:(books)'
                            ;;
                    esac
                    ;;
                releases)
                    case ${line[2]} in
                        new)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--days[how many days back to look, default 30]:days:(30 60 90 120 240 365)' \
                                '--category[only this category, by the id that releases categories prints. Without one the scan is a live sample, not the whole catalog]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '--language[Filter by language - exact match]' \
                                '--book-format[Filter by book format - e.g. unabridged]' \
                                '--explicit[Filter by explicit]:explicit:(true false)' \
                                '--whisper-sync[Filter by Whispersync availability]:whisper-sync:(true false)' \
                                '--has-pdf[Filter by PDF companion availability]:has-pdf:(true false)' \
                                '--is-vvab[Filter by VVAB - virtual voice audiobook status]:is-vvab:(true false)' \
                                '--plan-name[Filter by Audible plan name - e.g. US Minerva]' \
                                '--rating-better-than[Minimum rating]' \
                                '--rating-worse-than[Maximum rating]' \
                                '--longer-than[Minimum length in minutes]' \
                                '--shorter-than[Maximum length in minutes]' \
                                '--genre[Filter by genre or tag name - partial match, e.g. fantasy]' \
                                '--sort[sort the books by this field, default is the order they were found in]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default desc]:order:(asc desc)' \
                                '1:command:(new)'
                            ;;
                        coming-soon)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--days[how many days ahead to look, default 30]:days:(30 60 90 120 240 365)' \
                                '--category[only this category, by the id that releases categories prints. Without one the scan is a live sample, not the whole catalog]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '--language[Filter by language - exact match]' \
                                '--book-format[Filter by book format - e.g. unabridged]' \
                                '--explicit[Filter by explicit]:explicit:(true false)' \
                                '--whisper-sync[Filter by Whispersync availability]:whisper-sync:(true false)' \
                                '--has-pdf[Filter by PDF companion availability]:has-pdf:(true false)' \
                                '--is-vvab[Filter by VVAB - virtual voice audiobook status]:is-vvab:(true false)' \
                                '--plan-name[Filter by Audible plan name - e.g. US Minerva]' \
                                '--rating-better-than[Minimum rating]' \
                                '--rating-worse-than[Maximum rating]' \
                                '--longer-than[Minimum length in minutes]' \
                                '--shorter-than[Maximum length in minutes]' \
                                '--genre[Filter by genre or tag name - partial match, e.g. fantasy]' \
                                '--sort[sort the books by this field, default is the order they were found in]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '1:command:(coming-soon)'
                            ;;
                        categories)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--flat[a flat list, each node carrying its ancestors, instead of a tree]' \
                                '--depth[how many levels to return, 1 is the top level only, default all]' \
                                '--region[the Audible marketplace to ask, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(categories)'
                            ;;
                        *)
                            _arguments \
                                '1:command:(new coming-soon categories)'
                            ;;
                    esac
                    ;;
                db)
                    case ${line[2]} in
                        upgrade)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '1:command:(upgrade)'
                            ;;
                        status)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '1:command:(status)'
                            ;;
                        book)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the record of this marketplace, default the one stored first]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(book)' \
                                '2:ASIN:'
                            ;;
                        books)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--title[only books whose title contains this text]' \
                                '--subtitle[only books whose subtitle contains this text]' \
                                '--region[only books of this marketplace]:region:(us uk ca au de fr it es jp in br)' \
                                '--description[only books whose description contains this text]' \
                                '--summary[only books whose summary contains this text]' \
                                '--publisher[only books whose publisher contains this text]' \
                                '--copyright[only books whose copyright line contains this text]' \
                                '--isbn[only the book with this ISBN]' \
                                '--author-name[only books by an author whose name contains this text]' \
                                '--series-name[only books in a series whose name contains this text]' \
                                '--language[only books in this language]' \
                                '--rating-better-than[only books rated at least this]' \
                                '--rating-worse-than[only books rated at most this]' \
                                '--longer-than[only books at least this many minutes long]' \
                                '--shorter-than[only books at most this many minutes long]' \
                                '--explicit[only books that are explicit - true or are not - false]:explicit:(true false)' \
                                '--whisper-sync[only books with Whispersync - true or without - false]:whisper-sync:(true false)' \
                                '--has-pdf[only books with a PDF companion - true or without - false]:has-pdf:(true false)' \
                                '--book-format[only books of this format]' \
                                '--content-type[only books of this content type]' \
                                '--content-delivery-type[only books of this content delivery type]' \
                                '--is-listenable[only books that are listenable - true or are not - false]:is-listenable:(true false)' \
                                '--is-buyable[only books that are buyable - true or are not - false]:is-buyable:(true false)' \
                                '--is-vvab[only virtual voice audiobooks - true or none of them - false]:is-vvab:(true false)' \
                                '--plan-name[only books available under this Audible plan]' \
                                '--genre[only books with a genre or tag whose name contains this text, db genres lists them]' \
                                '--category[only books in this exact category id, or any of several separated by commas]' \
                                '--sort[sort the books by this field]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '--limit[results per page, 1 to 100, default 20]' \
                                '--page[page of results to return, counting from 1, default 1]' \
                                '1:command:(books)'
                            ;;
                        chapters)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the record of this marketplace, default the one stored first]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(chapters)' \
                                '2:ASIN:'
                            ;;
                        sku)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '1:command:(sku)' \
                                '2:SKU:'
                            ;;
                        author)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the marketplace of the author, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(author)' \
                                '2:ASIN:'
                            ;;
                        author-books)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the marketplace of the author, default us]:region:(us uk ca au de fr it es jp in br)' \
                                '--book-region[only books of this marketplace]:book-region:(us uk ca au de fr it es jp in br)' \
                                '--title[only books whose title contains this text]' \
                                '--subtitle[only books whose subtitle contains this text]' \
                                '--description[only books whose description contains this text]' \
                                '--summary[only books whose summary contains this text]' \
                                '--publisher[only books whose publisher contains this text]' \
                                '--copyright[only books whose copyright line contains this text]' \
                                '--isbn[only the book with this ISBN]' \
                                '--series-name[only books in a series whose name contains this text]' \
                                '--language[only books in this language]' \
                                '--rating-better-than[only books rated at least this]' \
                                '--rating-worse-than[only books rated at most this]' \
                                '--longer-than[only books at least this many minutes long]' \
                                '--shorter-than[only books at most this many minutes long]' \
                                '--explicit[only books that are explicit - true or are not - false]:explicit:(true false)' \
                                '--whisper-sync[only books with Whispersync - true or without - false]:whisper-sync:(true false)' \
                                '--has-pdf[only books with a PDF companion - true or without - false]:has-pdf:(true false)' \
                                '--book-format[only books of this format]' \
                                '--content-type[only books of this content type]' \
                                '--content-delivery-type[only books of this content delivery type]' \
                                '--is-listenable[only books that are listenable - true or are not - false]:is-listenable:(true false)' \
                                '--is-buyable[only books that are buyable - true or are not - false]:is-buyable:(true false)' \
                                '--is-vvab[only virtual voice audiobooks - true or none of them - false]:is-vvab:(true false)' \
                                '--plan-name[only books available under this Audible plan]' \
                                '--genre[only books with a genre or tag whose name contains this text, db genres lists them]' \
                                '--category[only books in this exact category id, or any of several separated by commas]' \
                                '--sort[sort the books by this field]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '1:command:(author-books)' \
                                '2:ASIN:'
                            ;;
                        series)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[the record of this marketplace, default the one stored first]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(series)' \
                                '2:ASIN:'
                            ;;
                        series-books)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--title[only books whose title contains this text]' \
                                '--subtitle[only books whose subtitle contains this text]' \
                                '--region[only books of this marketplace]:region:(us uk ca au de fr it es jp in br)' \
                                '--description[only books whose description contains this text]' \
                                '--summary[only books whose summary contains this text]' \
                                '--publisher[only books whose publisher contains this text]' \
                                '--copyright[only books whose copyright line contains this text]' \
                                '--isbn[only the book with this ISBN]' \
                                '--author-name[only books by an author whose name contains this text]' \
                                '--language[only books in this language]' \
                                '--rating-better-than[only books rated at least this]' \
                                '--rating-worse-than[only books rated at most this]' \
                                '--longer-than[only books at least this many minutes long]' \
                                '--shorter-than[only books at most this many minutes long]' \
                                '--explicit[only books that are explicit - true or are not - false]:explicit:(true false)' \
                                '--whisper-sync[only books with Whispersync - true or without - false]:whisper-sync:(true false)' \
                                '--has-pdf[only books with a PDF companion - true or without - false]:has-pdf:(true false)' \
                                '--book-format[only books of this format]' \
                                '--content-type[only books of this content type]' \
                                '--content-delivery-type[only books of this content delivery type]' \
                                '--is-listenable[only books that are listenable - true or are not - false]:is-listenable:(true false)' \
                                '--is-buyable[only books that are buyable - true or are not - false]:is-buyable:(true false)' \
                                '--is-vvab[only virtual voice audiobooks - true or none of them - false]:is-vvab:(true false)' \
                                '--plan-name[only books available under this Audible plan]' \
                                '--genre[only books with a genre or tag whose name contains this text, db genres lists them]' \
                                '--category[only books in this exact category id, or any of several separated by commas]' \
                                '--sort[sort the books by this field, replacing series order]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '1:command:(series-books)' \
                                '2:ASIN:'
                            ;;
                        narrators)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--gender[only narrators whose gender contains this text]' \
                                '--language[only narrators who work in this language]' \
                                '--audiobooks-produced[only narrators in this audiobooks-produced bucket]:audiobooks-produced:(1-10 11-20 21-50 51-100 more-than-100 none-yet)' \
                                '--source[only profiles from this source]' \
                                '--cultural-heritage[only narrators whose cultural heritage contains this text]' \
                                '--sort[sort by this field]:sort:(name source sourceUpdatedAt updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '--limit[results per page, 1 to 100, default 20]' \
                                '--page[page of results to return, counting from 1, default 1]' \
                                '1:command:(narrators)' \
                                '2:NAME:'
                            ;;
                        narrator-books)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--title[only books whose title contains this text]' \
                                '--subtitle[only books whose subtitle contains this text]' \
                                '--region[only books of this marketplace]:region:(us uk ca au de fr it es jp in br)' \
                                '--description[only books whose description contains this text]' \
                                '--summary[only books whose summary contains this text]' \
                                '--publisher[only books whose publisher contains this text]' \
                                '--copyright[only books whose copyright line contains this text]' \
                                '--isbn[only the book with this ISBN]' \
                                '--author-name[only books by an author whose name contains this text]' \
                                '--series-name[only books in a series whose name contains this text]' \
                                '--language[only books in this language]' \
                                '--rating-better-than[only books rated at least this]' \
                                '--rating-worse-than[only books rated at most this]' \
                                '--longer-than[only books at least this many minutes long]' \
                                '--shorter-than[only books at most this many minutes long]' \
                                '--explicit[only books that are explicit - true or are not - false]:explicit:(true false)' \
                                '--whisper-sync[only books with Whispersync - true or without - false]:whisper-sync:(true false)' \
                                '--has-pdf[only books with a PDF companion - true or without - false]:has-pdf:(true false)' \
                                '--book-format[only books of this format]' \
                                '--content-type[only books of this content type]' \
                                '--content-delivery-type[only books of this content delivery type]' \
                                '--is-listenable[only books that are listenable - true or are not - false]:is-listenable:(true false)' \
                                '--is-buyable[only books that are buyable - true or are not - false]:is-buyable:(true false)' \
                                '--is-vvab[only virtual voice audiobooks - true or none of them - false]:is-vvab:(true false)' \
                                '--plan-name[only books available under this Audible plan]' \
                                '--genre[only books with a genre or tag whose name contains this text, db genres lists them]' \
                                '--category[only books in this exact category id, or any of several separated by commas]' \
                                '--sort[sort the books by this field]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '--limit[results per page, 1 to 100, default 20]' \
                                '--page[page of results to return, counting from 1, default 1]' \
                                '1:command:(narrator-books)' \
                                '2:NAME:'
                            ;;
                        genres)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--search[only names that contain this text]' \
                                '1:command:(genres)'
                            ;;
                        plans)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '1:command:(plans)'
                            ;;
                        plan)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--title[only books whose title contains this text]' \
                                '--subtitle[only books whose subtitle contains this text]' \
                                '--region[only books of this marketplace]:region:(us uk ca au de fr it es jp in br)' \
                                '--description[only books whose description contains this text]' \
                                '--summary[only books whose summary contains this text]' \
                                '--publisher[only books whose publisher contains this text]' \
                                '--copyright[only books whose copyright line contains this text]' \
                                '--isbn[only the book with this ISBN]' \
                                '--author-name[only books by an author whose name contains this text]' \
                                '--series-name[only books in a series whose name contains this text]' \
                                '--language[only books in this language]' \
                                '--rating-better-than[only books rated at least this]' \
                                '--rating-worse-than[only books rated at most this]' \
                                '--longer-than[only books at least this many minutes long]' \
                                '--shorter-than[only books at most this many minutes long]' \
                                '--explicit[only books that are explicit - true or are not - false]:explicit:(true false)' \
                                '--whisper-sync[only books with Whispersync - true or without - false]:whisper-sync:(true false)' \
                                '--has-pdf[only books with a PDF companion - true or without - false]:has-pdf:(true false)' \
                                '--book-format[only books of this format]' \
                                '--content-type[only books of this content type]' \
                                '--content-delivery-type[only books of this content delivery type]' \
                                '--is-listenable[only books that are listenable - true or are not - false]:is-listenable:(true false)' \
                                '--is-buyable[only books that are buyable - true or are not - false]:is-buyable:(true false)' \
                                '--is-vvab[only virtual voice audiobooks - true or none of them - false]:is-vvab:(true false)' \
                                '--genre[only books with a genre or tag whose name contains this text, db genres lists them]' \
                                '--category[only books in this exact category id, or any of several separated by commas]' \
                                '--sort[sort the books by this field]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '--limit[results per page, 1 to 100, default 20]' \
                                '--page[page of results to return, counting from 1, default 1]' \
                                '1:command:(plan)' \
                                '2:NAME:'
                            ;;
                        vvab)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--title[only books whose title contains this text]' \
                                '--subtitle[only books whose subtitle contains this text]' \
                                '--region[only books of this marketplace]:region:(us uk ca au de fr it es jp in br)' \
                                '--description[only books whose description contains this text]' \
                                '--summary[only books whose summary contains this text]' \
                                '--publisher[only books whose publisher contains this text]' \
                                '--copyright[only books whose copyright line contains this text]' \
                                '--isbn[only the book with this ISBN]' \
                                '--author-name[only books by an author whose name contains this text]' \
                                '--series-name[only books in a series whose name contains this text]' \
                                '--language[only books in this language]' \
                                '--rating-better-than[only books rated at least this]' \
                                '--rating-worse-than[only books rated at most this]' \
                                '--longer-than[only books at least this many minutes long]' \
                                '--shorter-than[only books at most this many minutes long]' \
                                '--explicit[only books that are explicit - true or are not - false]:explicit:(true false)' \
                                '--whisper-sync[only books with Whispersync - true or without - false]:whisper-sync:(true false)' \
                                '--has-pdf[only books with a PDF companion - true or without - false]:has-pdf:(true false)' \
                                '--book-format[only books of this format]' \
                                '--content-type[only books of this content type]' \
                                '--content-delivery-type[only books of this content delivery type]' \
                                '--is-listenable[only books that are listenable - true or are not - false]:is-listenable:(true false)' \
                                '--is-buyable[only books that are buyable - true or are not - false]:is-buyable:(true false)' \
                                '--plan-name[only books available under this Audible plan]' \
                                '--genre[only books with a genre or tag whose name contains this text, db genres lists them]' \
                                '--category[only books in this exact category id, or any of several separated by commas]' \
                                '--sort[sort the books by this field]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '--limit[results per page, 1 to 100, default 20]' \
                                '--page[page of results to return, counting from 1, default 1]' \
                                '1:command:(vvab)'
                            ;;
                        new-releases)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--days[how many days back to look, default 30]:days:(30 60 90 120 240 365)' \
                                '--title[only books whose title contains this text]' \
                                '--subtitle[only books whose subtitle contains this text]' \
                                '--region[only books of this marketplace]:region:(us uk ca au de fr it es jp in br)' \
                                '--description[only books whose description contains this text]' \
                                '--summary[only books whose summary contains this text]' \
                                '--publisher[only books whose publisher contains this text]' \
                                '--copyright[only books whose copyright line contains this text]' \
                                '--isbn[only the book with this ISBN]' \
                                '--author-name[only books by an author whose name contains this text]' \
                                '--series-name[only books in a series whose name contains this text]' \
                                '--language[only books in this language]' \
                                '--rating-better-than[only books rated at least this]' \
                                '--rating-worse-than[only books rated at most this]' \
                                '--longer-than[only books at least this many minutes long]' \
                                '--shorter-than[only books at most this many minutes long]' \
                                '--explicit[only books that are explicit - true or are not - false]:explicit:(true false)' \
                                '--whisper-sync[only books with Whispersync - true or without - false]:whisper-sync:(true false)' \
                                '--has-pdf[only books with a PDF companion - true or without - false]:has-pdf:(true false)' \
                                '--book-format[only books of this format]' \
                                '--content-type[only books of this content type]' \
                                '--content-delivery-type[only books of this content delivery type]' \
                                '--is-listenable[only books that are listenable - true or are not - false]:is-listenable:(true false)' \
                                '--is-buyable[only books that are buyable - true or are not - false]:is-buyable:(true false)' \
                                '--is-vvab[only virtual voice audiobooks - true or none of them - false]:is-vvab:(true false)' \
                                '--plan-name[only books available under this Audible plan]' \
                                '--genre[only books with a genre or tag whose name contains this text, db genres lists them]' \
                                '--category[only books in this exact category id, or any of several separated by commas]' \
                                '--sort[sort the books by this field]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default desc]:order:(asc desc)' \
                                '--limit[results per page, 1 to 100, default 20]' \
                                '--page[page of results to return, counting from 1, default 1]' \
                                '1:command:(new-releases)'
                            ;;
                        coming-soon)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--days[how many days ahead to look, default 30]:days:(30 60 90 120 240 365)' \
                                '--title[only books whose title contains this text]' \
                                '--subtitle[only books whose subtitle contains this text]' \
                                '--region[only books of this marketplace]:region:(us uk ca au de fr it es jp in br)' \
                                '--description[only books whose description contains this text]' \
                                '--summary[only books whose summary contains this text]' \
                                '--publisher[only books whose publisher contains this text]' \
                                '--copyright[only books whose copyright line contains this text]' \
                                '--isbn[only the book with this ISBN]' \
                                '--author-name[only books by an author whose name contains this text]' \
                                '--series-name[only books in a series whose name contains this text]' \
                                '--language[only books in this language]' \
                                '--rating-better-than[only books rated at least this]' \
                                '--rating-worse-than[only books rated at most this]' \
                                '--longer-than[only books at least this many minutes long]' \
                                '--shorter-than[only books at most this many minutes long]' \
                                '--explicit[only books that are explicit - true or are not - false]:explicit:(true false)' \
                                '--whisper-sync[only books with Whispersync - true or without - false]:whisper-sync:(true false)' \
                                '--has-pdf[only books with a PDF companion - true or without - false]:has-pdf:(true false)' \
                                '--book-format[only books of this format]' \
                                '--content-type[only books of this content type]' \
                                '--content-delivery-type[only books of this content delivery type]' \
                                '--is-listenable[only books that are listenable - true or are not - false]:is-listenable:(true false)' \
                                '--is-buyable[only books that are buyable - true or are not - false]:is-buyable:(true false)' \
                                '--is-vvab[only virtual voice audiobooks - true or none of them - false]:is-vvab:(true false)' \
                                '--plan-name[only books available under this Audible plan]' \
                                '--genre[only books with a genre or tag whose name contains this text, db genres lists them]' \
                                '--category[only books in this exact category id, or any of several separated by commas]' \
                                '--sort[sort the books by this field]:sort:(title releaseDate rating lengthMinutes language publisher updatedAt)' \
                                '--order[the direction of --sort, default asc]:order:(asc desc)' \
                                '--limit[results per page, 1 to 100, default 20]' \
                                '--page[page of results to return, counting from 1, default 1]' \
                                '1:command:(coming-soon)'
                            ;;
                        stats)
                            _arguments \
                                '(- *)'{-h,--help}'[show this help message and exit]' \
                                '--region[count only this marketplace, default all]:region:(us uk ca au de fr it es jp in br)' \
                                '1:command:(stats)'
                            ;;
                        *)
                            _arguments \
                                '1:command:(upgrade status book books chapters sku author author-books series series-books narrators narrator-books genres plans plan vvab new-releases coming-soon stats)'
                            ;;
                    esac
                    ;;
                completion)
                    _arguments \
                        '(- *)'{-h,--help}'[show this help message and exit]' \
                        '1:shell:(bash zsh fish)'
                    ;;
                config)
                    _arguments \
                        '(- *)'{-h,--help}'[show this help message and exit]'
                    ;;
            esac
            ;;
    esac
}

_libex-core "$@"
