#compdef calibre lrf2lrs ebook-meta ebook-polish lrfviewer ebook-viewer ebook-edit fetch-ebook-metadata calibre-smtp calibre-server calibre-debug calibredb ebook-convert

_ebc_input_args() {
  local extras; extras=(
    {-h,--help}":Show Help"
    "--version:Show program version"
    "--list-recipes:List builtin recipe names"
    " fluter. .recipe"
    ".týždeň.recipe"
    "10minutos.recipe"
    "1843.recipe"
    "20 Minutos.recipe"
    "20 minutes.recipe"
    "324.cat.recipe"
    "3DNews\: Daily Digital Digest.recipe"
    "4Łomza.recipe"
    "7x7.recipe"
    "A List Apart.recipe"
    "ABC Linuxu.recipe"
    "ABC News.recipe"
    "ABC.es.recipe"
    "ACM CACM Magazine.recipe"
    "ACM Queue Magazine.recipe"
    "AD.recipe"
    "AM730.recipe"
    "Academia Caţavencu.recipe"
    "Acrimed.recipe"
    "Adevărul.recipe"
    "Adnkronos.recipe"
    "Adventure Gamers.recipe"
    "Al Jazeera in English.recipe"
    "Al Monitor.recipe"
    "Albert Mohler's Blog.recipe"
    "Aleja Komiksu.recipe"
    "Alt om DATA, Datatid TechLife - Download, test, antivirus, netværk.recipe"
    "Ambito.com.recipe"
    "American Prospect.recipe"
    "American Thinker.recipe"
    "Anandtech.recipe"
    "Android Police.recipe"
    "Android.com.pl.recipe"
    "Animal Político.recipe"
    "Antyweb.recipe"
    "Arbetaren.recipe"
    "Arcamax.recipe"
    "Arizona Daily Star.recipe"
    "Army and Navy Times.recipe"
    "Arrêt sur images.recipe"
    "Ars Technica.recipe"
    "Arts and Letters Daily.recipe"
    "Asco de vida.recipe"
    "Associated Press.recipe"
    "AstroNEWS.recipe"
    "Astronomy Picture of the Day.recipe"
    "Australian Financial Review.recipe"
    "Aviation International News.recipe"
    "Avisen.dk.recipe"
    "Avto Magazin.recipe"
    "BBC Brasil.recipe"
    "BBC Mundo.recipe"
    "BBC News.recipe"
    "BBC News (fast).recipe"
    "BBC Russian.recipe"
    "BBC Sport.recipe"
    "BBC Ukrainian.recipe"
    "BBC Vietnamese.recipe"
    "BQ Prime.recipe"
    "BT Nyheder.recipe"
    "BUGÜN Gazetesi.recipe"
    "Backyard Boss.recipe"
    "Bangkok Post.recipe"
    "Bar and Bench.recipe"
    "Barron's Magazine.recipe"
    "Before We Go.recipe"
    "Bellingcat.recipe"
    "Benchmark.pl.recipe"
    "Bergfreunde Blog.recipe"
    "BiaMag.recipe"
    "Bianet.recipe"
    "Bianet-English.recipe"
    "Big Government.recipe"
    "BigOven.recipe"
    "Bild.de.recipe"
    "Bill O'Reilly.recipe"
    "Birmingham Evening Mail.recipe"
    "Blesk.recipe"
    "Blic.recipe"
    "Blog VioMundo.recipe"
    "Bloomberg.recipe"
    "Bloomberg Businessweek.recipe"
    "Bookforum.recipe"
    "Boston Globe.recipe"
    "Boston Globe | Print Edition.recipe"
    "Breaking Mad.recipe"
    "Brewiarz.recipe"
    "Brigitte.de.recipe"
    "Bucataras.recipe"
    "Buenos Aires Herald.recipe"
    "Business Insider.recipe"
    "Business Standard.recipe"
    "Business Standard Print Edition.recipe"
    "Business Today Magazine.recipe"
    "Børsen.dk.recipe"
    "CBC Canada.recipe"
    "CBN News.recipe"
    "CIPER Chile.recipe"
    "CNET Japan.recipe"
    "CNET Japan Digital.recipe"
    "CNET Japan release.recipe"
    "CNET News.recipe"
    "CNN.recipe"
    "Cachys Blog.recipe"
    "Calcalist.recipe"
    "Calgary Herald.recipe"
    "CanardPC.recipe"
    "Capital.gr.recipe"
    "Car Buzz.recipe"
    "Caravan Magazine.recipe"
    "Catholic News Agency.recipe"
    "Caţavencii.recipe"
    "Ce se întâmplă doctore?.recipe"
    "Champion.com.ua.recipe"
    "Chicago Tribune.recipe"
    "Cicero Online.recipe"
    "Cincinnati Enquirer.recipe"
    "Clarín.recipe"
    "Coda.recipe"
    "Coda на русском.recipe"
    "Collider.recipe"
    "Colta.ru.recipe"
    "Comic Book Archive.recipe"
    "Common Dreams.recipe"
    "ComputerWeekly.recipe"
    "Computerworld.dk.recipe"
    "Contropiano.recipe"
    "Correio da Manha - Portugal.recipe"
    "Cosmos Magazine.recipe"
    "Courrier International.recipe"
    "Cracked.com.recipe"
    "Creative Blog.recipe"
    "Crikey.recipe"
    "CubaDebate.recipe"
    "Cumhuriyet.recipe"
    "Cvece zla i naopakog.recipe"
    "Czytania na każdy dzień.recipe"
    "DNA India.recipe"
    "DR Nyheder.recipe"
    "Dachauer Nachrichten.recipe"
    "Dagens Industri.recipe"
    "Dagens Medicin.recipe"
    "Dagens Nyheter.recipe"
    "Dagens Pharma.recipe"
    "Daily Writing Tips.recipe"
    "Danas.recipe"
    "Dark Horizons.recipe"
    "Dawn.recipe"
    "De Gentenaar.recipe"
    "De Morgen.recipe"
    "De Standaard.recipe"
    "De Tijd.recipe"
    "Debunking Denialism.recipe"
    "Deccan Herald.recipe"
    "Democracy Journal.recipe"
    "Democracy now!.recipe"
    "Den of Geek.recipe"
    "Denver Post.recipe"
    "Deník N.recipe"
    "Deník Referendum.recipe"
    "Der Tagesspiegel.recipe"
    "Deredactie.be.recipe"
    "Derin Dusunce.recipe"
    "Descoperă.recipe"
    "Desiring God.recipe"
    "Deutsche Welle.recipe"
    "Deutsche Welle на русском.recipe"
    "Deutschlandfunk & Deutschlandfunk Kultur.recipe"
    "Developpez.com.recipe"
    "Diario El Pueblo.recipe"
    "Diario Granma.recipe"
    "Diario Sport.recipe"
    "Diario Vasco.recipe"
    "Diario de Ibiza digital.recipe"
    "Die Presse.recipe"
    "Die Zeit.recipe"
    "DigiZone.recipe"
    "Dilema.recipe"
    "Discover Magazine Monthly.recipe"
    "DistroWatch Weekly.recipe"
    "Dnevnik - Hr.recipe"
    "Dobreprogramy.pl.recipe"
    "Dorfener Anzeiger.recipe"
    "DrawAndCook.recipe"
    "Drytooling.com.pl.recipe"
    "Dual SHOCKERS.recipe"
    "Dwutygodnik.recipe"
    "Dziennik Bałtycki.recipe"
    "Dziennik Internautów.recipe"
    "Dziennik Polski.recipe"
    "Dziennik Wschodni.recipe"
    "Dziennik Zachodni.recipe"
    "Dziennik Związkowy.recipe"
    "Dziennik Łódzki.recipe"
    "Dziennik.pl.recipe"
    "EPL Talk.recipe"
    "EPW Magazine.recipe"
    "ESO PL.recipe"
    "ESPN.recipe"
    "Ebersberger Zeitung.recipe"
    "Economia Magazine.recipe"
    "Economic and Political Weekly.recipe"
    "Economico.recipe"
    "Edmonton Journal.recipe"
    "Ekot.recipe"
    "El Cohete a la Luna.recipe"
    "El Confidencial.recipe"
    "El Correo.recipe"
    "El Cronista.recipe"
    "El Faro de Vigo.recipe"
    "El Mundo.recipe"
    "El Mundo Today.recipe"
    "El Pais - Uruguay.recipe"
    "El Pais Babelia.recipe"
    "El Pais semanal.recipe"
    "El País.recipe"
    "El Periodico de Catalunya.recipe"
    "ElNacional.cat.recipe"
    "Elektroda.recipe"
    "Emol.com - El sitio de noticias online de Chile.recipe"
    "Engadget.recipe"
    "Entrepeneur Magazine.recipe"
    "Equestria Daily.recipe"
    "Erdinger Anzeiger.recipe"
    "Esensja.recipe"
    "Esensja (RSS).recipe"
    "Esquire.recipe"
    "Europa Press.recipe"
    "Everett Herald.recipe"
    "Expansion.recipe"
    "FOX News.recipe"
    "Factcheck.recipe"
    "Fairbanks Daily News-miner.recipe"
    "FanGraphs.recipe"
    "Fast Company.recipe"
    "Film.org.pl.recipe"
    "FilmWeb.recipe"
    "Financial Sense.recipe"
    "Financial Times.recipe"
    "Financiarul.recipe"
    "First Things.recipe"
    "Firstpost.recipe"
    "Flickr Blog.recipe"
    "Focus.recipe"
    "Focus (DE).recipe"
    "Fokke en Sukke.recipe"
    "Fokus.recipe"
    "Folha de São Paolo.recipe"
    "Folha de São Paulo.recipe"
    "Folha de São Paulo - portal.recipe"
    "Football Fancast.recipe"
    "Football.UA.recipe"
    "Foreign Affairs.recipe"
    "Foreign Policy.recipe"
    "Fortune Magazine.recipe"
    "FrAndroid.recipe"
    "Free Inquiry.recipe"
    "Freisinger Tagblatt.recipe"
    "Frontline.recipe"
    "Fudzilla.recipe"
    "Futurismic.recipe"
    "Fürstenfeldbrucker Tagblatt.recipe"
    "GWUP | Die Skeptiker.recipe"
    "Gagadget.recipe"
    "Galicia Confidencial (RSS).recipe"
    "Game Rant.recipe"
    "Gamekult.com.recipe"
    "Gameplay.pl.recipe"
    "Garmisch-Partenkirchener Tagblatt.recipe"
    "Gates Notes.recipe"
    "Gazet van Antwerpen.recipe"
    "Gazeta Krakowska.recipe"
    "Gazeta Prawna.recipe"
    "Gazeta Sporturilor.recipe"
    "Gazeta Wyborcza Kraków.recipe"
    "Gazeta Wyborcza Warszawa.recipe"
    "Gazeta.ua.recipe"
    "GeekCity.recipe"
    "General Knowledge Today.recipe"
    "Geopolityka.org.recipe"
    "Geretsrieder Merkur.recipe"
    "Github Blog.recipe"
    "Give Me Sports.recipe"
    "Glasgow Herald.recipe"
    "Glenn Greenwald | guardian.co.uk.recipe"
    "Global Times.recipe"
    "Globes.recipe"
    "Globes in English.recipe"
    "Go Comics.recipe"
    "Golem.de.recipe"
    "Good House Keeping.recipe"
    "Good e-Reader.recipe"
    "Google News.recipe"
    "Gość Niedzielny.recipe"
    "Gość Niedzielny - pełny numer.recipe"
    "Gram.pl.recipe"
    "Grandes corresponsales.recipe"
    "Granta.recipe"
    "Grantland.recipe"
    "Greatist.recipe"
    "Greensboro News & Record.recipe"
    "Gry-Online.pl.recipe"
    "HN With Actual Comments.recipe"
    "HNA.recipe"
    "HOY.recipe"
    "HVG.recipe"
    "Haaretz.recipe"
    "Habr.recipe"
    "Haksöz.recipe"
    "Hamilton Spectator.recipe"
    "Handelsblatt.recipe"
    "Hankyoreh21.recipe"
    "Hannoversche Allgemeine Zeitung.recipe"
    "Hardcore Gamer.recipe"
    "Harper’s Magazine.recipe"
    "Harvard Business Review.recipe"
    "Hatalska.recipe"
    "Healthline.recipe"
    "Heise ct.recipe"
    "Het Financieele Dagblad.recipe"
    "Het Laatste Nieuws.recipe"
    "Het Parool.recipe"
    "High Country News.recipe"
    "Himal Southasian.recipe"
    "Hindu Post.recipe"
    "Hinduism Today.recipe"
    "Hindustan Times.recipe"
    "Hindustan Times Print Edition.recipe"
    "Historia.org.pl.recipe"
    "History Today.recipe"
    "Holzkirchener Merkur.recipe"
    "Honolulu Star-Advertiser.recipe"
    "Horizons.recipe"
    "Hot Air.recipe"
    "Hot Cars.recipe"
    "How-To Geek.recipe"
    "Hürriyet.recipe"
    "IEEE Spectrum Magazine.recipe"
    "IEEE Spectrum Online.recipe"
    "IN4.pl.recipe"
    "IOL News.recipe"
    "Il Corriere della sera.recipe"
    "Il Disinformatico - Paolo Attivissimo.recipe"
    "Il Fatto Quotidiano.recipe"
    "Il Manifesto.recipe"
    "Il Messaggero.recipe"
    "Il Post.recipe"
    "Il Sole 24 Ore.recipe"
    "Imperator Travel.recipe"
    "Impulse.de.recipe"
    "Inc Magazine.recipe"
    "Inc42.recipe"
    "Independent Australia.recipe"
    "Index.hu.recipe"
    "India Legal Magazine.recipe"
    "India Today Magazine.recipe"
    "IndiaFacts.recipe"
    "IndiaSpeaksReddit.recipe"
    "Indian Express.recipe"
    "Indic Today.recipe"
    "Infobae.com.recipe"
    "Information - Denmark.recipe"
    "Ingeniøren.recipe"
    "Inquirer.net.recipe"
    "Instapaper.recipe"
    "Intelligencer.recipe"
    "Interfax-Ukraine.recipe"
    "Internazionale.recipe"
    "Irish Independent.recipe"
    "Isar-Loisachbote.recipe"
    "Istòrias.recipe"
    "Izvestia.recipe"
    "Jacobin.recipe"
    "Jakarta Post.recipe"
    "Javalobby.recipe"
    "Jerusalem Post.recipe"
    "JeuxVideo.com.recipe"
    "Joop.recipe"
    "Jot Down - Contemporary Culture Magazine.recipe"
    "Journal of Accountancy.recipe"
    "Journal of Hospital Medicine.recipe"
    "Juventud Rebelde.recipe"
    "KA-News.de.recipe"
    "KDE News.recipe"
    "Kansas City Star.recipe"
    "Kirkus Reviews.recipe"
    "Kitekintő.recipe"
    "Kleine Zeitung.recipe"
    "Kommersant.recipe"
    "Kommunal Sundhed.recipe"
    "Konflikty Zbrojne.recipe"
    "Kopalnia Wiedzy.recipe"
    "Korben.recipe"
    "KoreaHerald.recipe"
    "Kosmonauta.net.recipe"
    "Krebs on Security.recipe"
    "Kresy.recipe"
    "Kudika.recipe"
    "Kudy z nudy.recipe"
    "Kurier.recipe"
    "Kurier Lubelski.recipe"
    "Kyiv Post.recipe"
    "Kyungyhang.recipe"
    "L'express.recipe"
    "LWN Linux Weekly News (Free).recipe"
    "LWN.net Weekly Edition.recipe"
    "La Derniere Heure.recipe"
    "La Jornada (Mexico).recipe"
    "La Libre Belgique.recipe"
    "La Nacion.recipe"
    "La Nacion Costa Rica.recipe"
    "La Nueva España.recipe"
    "La Politica Online.recipe"
    "La Prensa.recipe"
    "La Repubblica.recipe"
    "La Stampa.recipe"
    "La Voce.recipe"
    "Lamebook.recipe"
    "Las Vegas Review Journal.recipe"
    "Le Canard Enchaîné.recipe"
    "Le Devoir .recipe"
    "Le GORAFI.fr.recipe"
    "Le Monde.recipe"
    "Le Monde Diplomatique - cono sur.recipe"
    "Le Monde diplomatique - English edition.recipe"
    "Le Monde diplomatique.fr.recipe"
    "Le Monde in English.recipe"
    "Le Monde\: Édition abonnés.recipe"
    "Le Monde\: Édition abonnés papier.recipe"
    "Le Nouvel Observateur.recipe"
    "Le Peuple Breton.recipe"
    "Le Point.recipe"
    "Lega Nerd.recipe"
    "Lege Artis.recipe"
    "Leggo.it.recipe"
    "Lenta.ru - Новости.recipe"
    "Lex Fridman Podcast.recipe"
    "Liberatorio Politico.recipe"
    "Libertad Digital.recipe"
    "Libération.recipe"
    "LifeHacker.recipe"
    "Lightspeed Magazine.recipe"
    "Limba Sarda 2.0.recipe"
    "Linux Magazine.recipe"
    "Linux News.recipe"
    "LinuxPortal.recipe"
    "Live Law.recipe"
    "Live Mint.recipe"
    "Live Science.recipe"
    "London Review of Books.recipe"
    "Los Angeles Times.recipe"
    "Ludwig von Mises Institute.recipe"
    "Lupa.recipe"
    "MIT Technology Review Magazine.recipe"
    "MMC RTV Slovenija.recipe"
    "MSNBC.recipe"
    "Macrobusiness.recipe"
    "Magyar Nemzet.recipe"
    "Mail & Guardian ZA News.recipe"
    "Make Use of.recipe"
    "Mallorca Zeitung.recipe"
    "Marc Toensings Visionen.recipe"
    "Marca.recipe"
    "Marietta Daily Journal.recipe"
    "Marketing Magazine.recipe"
    "Martin Fowler Blog.recipe"
    "Maskinbladet.recipe"
    "Max-Planck-Gesellschaft.recipe"
    "MedScape.recipe"
    "Media Indonesia.recipe"
    "Media2.recipe"
    "Mediafax.recipe"
    "Mediapart.recipe"
    "Meduza.recipe"
    "Merco Press.recipe"
    "Michelle Malkin.recipe"
    "Microwave Journal.recipe"
    "Miesbacher Merkur.recipe"
    "Modoros Blog.recipe"
    "Monden.recipe"
    "Money Control.recipe"
    "Montevideo COMM.recipe"
    "Montreal Gazette.recipe"
    "Mother Jones.recipe"
    "Murnauer Tagblatt.recipe"
    "Muy Interesante México.recipe"
    "MyApple.pl.recipe"
    "MyDealz.recipe"
    "Múlt-Kor.recipe"
    "Münchner Merkur Nord.recipe"
    "Münchner Merkur Stadt.recipe"
    "Münchner Merkur Süd.recipe"
    "Münchner Merkur Würmtal.recipe"
    "Měšec.recipe"
    "N+1.recipe"
    "NASA.recipe"
    "NHK News.recipe"
    "NOL.recipe"
    "NRC.recipe"
    "NRC Handelsblad.recipe"
    "NSPM in English.recipe"
    "NV (The New Voice of Ukraine).recipe"
    "NY Times Cooking.recipe"
    "NYT Magazine.recipe"
    "NYT News.recipe"
    "NYT T Magazine.recipe"
    "NZZ.recipe"
    "NaTemat.pl.recipe"
    "Nachdenkseiten.recipe"
    "Nacional - Hr.recipe"
    "Najwyższy Czas.recipe"
    "Naked Capitalism.recipe"
    "Nasz Dziennik.recipe"
    "National Geographic.recipe"
    "National Geographic (es).recipe"
    "National Geographic History.recipe"
    "National Geographic Kids.recipe"
    "National Geographic Magazine.recipe"
    "National Geographic Traveller.recipe"
    "National Post.recipe"
    "National Public Radio.recipe"
    "Nature.recipe"
    "Nature News.recipe"
    "Nautilus Magazine.recipe"
    "Neowin.net.recipe"
    "Netzpolitik.recipe"
    "New England Journal of Medicine.recipe"
    "New Musical Express Magazine.recipe"
    "New Scientist - Online News w. subscription.recipe"
    "New Scientist Magazine.recipe"
    "New Statesman.recipe"
    "New Straits Times from Malaysia.recipe"
    "New York Magazine.recipe"
    "New York Post.recipe"
    "New York Review of Books.recipe"
    "New York Review of Books (no subscription).recipe"
    "New York Times Book Review.recipe"
    "New York Times Sports Beat.recipe"
    "New York Times Technology Beat.recipe"
    "New Zealand Herald.recipe"
    "News Busters.recipe"
    "News On Japan.recipe"
    "News24.recipe"
    "Newslaundry.recipe"
    "Newsweek Polska.recipe"
    "Nezavisne novine.recipe"
    "Niebezpiecznik.pl.recipe"
    "Nikkei Asia Magazine.recipe"
    "Njuz.net.recipe"
    "Nordjyske.dk.recipe"
    "Nova srpska politicka misao.recipe"
    "Novaya Gazeta.recipe"
    "Novaya Gazeta Europe.recipe"
    "Novi List.recipe"
    "Novinite.bg.recipe"
    "Novinite.com.recipe"
    "Novinky.recipe"
    "Nowy Obywatel.recipe"
    "Nu.nl.recipe"
    "Népszabadság.recipe"
    "Oakland North.recipe"
    "Observatorul cultural.recipe"
    "Observer Research Foundation.recipe"
    "Oil Price.recipe"
    "Old-Games.RU.recipe"
    "Omg! Ubuntu!.recipe"
    "Onda Rock.recipe"
    "Open Magazine.recipe"
    "OpenNet.ru.recipe"
    "Orange County Register.recipe"
    "Ottawa Citizen.recipe"
    "Our Daily Bread.recipe"
    "Outlook Business Magazine.recipe"
    "Outlook Magazine.recipe"
    "Oxford Mail.recipe"
    "Ośrodek Studiów Wschodnich.recipe"
    "PC Foster.recipe"
    "PCWORLD.HU.recipe"
    "PCWorld.recipe"
    "Padre y Decano.recipe"
    "Pagina - 12.recipe"
    "Pagina/12 - Edicion Impresa.recipe"
    "Pajamas Media.recipe"
    "Pambianco.recipe"
    "Parlamentní Listy.recipe"
    "Pc Advisor .recipe"
    "Penzberger Merkur.recipe"
    "Periódico El Colombiano.recipe"
    "Periódico Portafolio Colombia.recipe"
    "Peščanik.recipe"
    "Philosophy Now.recipe"
    "Phoronix.recipe"
    "PhysOrg.recipe"
    "Planet Python.recipe"
    "Pocket.recipe"
    "Pocket-lint.recipe"
    "Podnikatel.recipe"
    "Politico.recipe"
    "Politico.eu.recipe"
    "Politiken.dk.recipe"
    "Politiko | Berlingskes politiske site.recipe"
    "Polizeipresse - Deutschland.recipe"
    "Polter.pl.recipe"
    "Popular Science.recipe"
    "Pragyata.recipe"
    "Pravda.recipe"
    "Pravda em português.recipe"
    "Press Information Bureau.recipe"
    "Presseportal DE.recipe"
    "Private Eye Online.recipe"
    "Pro Physik.recipe"
    "Pro Publica.recipe"
    "Project Syndicate.recipe"
    "Prospect Magazine (Free).recipe"
    "Protagon.recipe"
    "Psychology Today.recipe"
    "Publico.PT.recipe"
    "Punto Informatico .recipe"
    "PurePC.recipe"
    "Quanta Magazine.recipe"
    "Que Leer.recipe"
    "RBC.ru.recipe"
    "RDS.recipe"
    "RIA Novosti - Russian.recipe"
    "RT на русском.recipe"
    "RTE News.recipe"
    "RTS\: Vesti.recipe"
    "Radio Canada.recipe"
    "Radio Praha.recipe"
    "Readers Digest.recipe"
    "Real Clear.recipe"
    "Real-world economis review blog.recipe"
    "Reason.recipe"
    "Red Voltaire.recipe"
    "RedaktionsNetzwerk Deutschland.recipe"
    "Reflex.recipe"
    "Regina Leader-Post.recipe"
    "Respekt Magazine — Print.recipe"
    "Reuters.recipe"
    "Revista 22.recipe"
    "Revista El Cultural.recipe"
    "Revista Muy Interesante.recipe"
    "Revista Veintitres.recipe"
    "Rmf24.pl - Ekonomia Sport Kultura Nauka.recipe"
    "Rmf24.pl - Fakty.recipe"
    "Rmf24.pl - Opinie.recipe"
    "Root.cz.recipe"
    "Rushisaband.recipe"
    "Russia Today.recipe"
    "RussiaFeed News.recipe"
    "Rzeczpospolita OnLine.recipe"
    "SATKurier.pl.recipe"
    "SC Print Magazine.recipe"
    "SKAI.recipe"
    "SOTA.Vision.recipe"
    "SOVA.recipe"
    "SVT Nyheter.recipe"
    "Sabah.recipe"
    "Saechsische Zeitung.recipe"
    "Salon.com.recipe"
    "Salzburger Nachrichten.recipe"
    "San Francisco Bay Guardian.recipe"
    "San Francisco Chronicle.recipe"
    "San Jose Mercury News.recipe"
    "Saskatoon Star-Phoenix.recipe"
    "SatMagazine.recipe"
    "Schongauer Nachrichten.recipe"
    "Science Advances.recipe"
    "Science Based Medicine.recipe"
    "Science Immunology.recipe"
    "Science Journal.recipe"
    "Science News.recipe"
    "Science Robotics.recipe"
    "Science Signaling.recipe"
    "Science Translational Medicine.recipe"
    "Science X.recipe"
    "Scientific American.recipe"
    "Scinexx.de.recipe"
    "Scott Hanselman's Computer Zen.recipe"
    "Screen Rant.recipe"
    "Scroll.in.recipe"
    "Sekurak.recipe"
    "Seminar Magazine.recipe"
    "Sign of the Times.recipe"
    "Simple Flying.recipe"
    "Slashdot.org.recipe"
    "Slate.recipe"
    "Smashing Magazine.recipe"
    "Smithsonian Magazine.recipe"
    "Sonar21.recipe"
    "South China Morning Post.recipe"
    "Spectator Australia.recipe"
    "Spectator Magazine.recipe"
    "Spektrum der Wissenschaft.recipe"
    "Spiegel Online International.recipe"
    "Spiegel Online RSS - German alle Themen.recipe"
    "Sports Illustrated.recipe"
    "Sportstar.recipe"
    "Sputnik News.recipe"
    "St Louis Post-Dispatch.recipe"
    "Stack Overflow - Blog.recipe"
    "Stanisław Michalkiewicz.recipe"
    "Star Gazetesi.recipe"
    "Starnberger Merkur.recipe"
    "StopGame.recipe"
    "Strange Horizons.recipe"
    "Substack.recipe"
    "Swarajya Magazine.recipe"
    "Süddeutsche Zeitung.recipe"
    "Süddeutsche Zeitung Magazin.recipe"
    "Săptămâna Financiară.recipe"
    "T-Invariant.recipe"
    "T-Online.recipe"
    "TIME Magazine.recipe"
    "TJournal.recipe"
    "TOI Print Edition.recipe"
    "TV 2 Lorry.recipe"
    "TV 2 | ØSTJYLLAND.recipe"
    "TV MIDTVEST.recipe"
    "TV SYD.recipe"
    "TV2 Nord.recipe"
    "TVmania.recipe"
    "Tablety.pl.recipe"
    "Tabu.recipe"
    "Tagesanzeiger.recipe"
    "Tagespost.recipe"
    "Tagesschau.recipe"
    "Taz - die Tageszeitung.recipe"
    "Tech Dirt.recipe"
    "TechCrunch.recipe"
    "Tegernseer Zeitung.recipe"
    "Tehelka.recipe"
    "Telepolis.recipe"
    "Teleread Blog.recipe"
    "Thairath.recipe"
    "The Age.recipe"
    "The American Spectator.recipe"
    "The Asahi Shimbun.recipe"
    "The Asian Review of Books.recipe"
    "The Atlantic.recipe"
    "The Australian.recipe"
    "The Baffler.recipe"
    "The Baltimore Sun.recipe"
    "The Bell.recipe"
    "The Big Picture.recipe"
    "The Budget Fashionista.recipe"
    "The CATO Institute.recipe"
    "The Christian Post.recipe"
    "The Christian Science Monitor - daily.recipe"
    "The Chronicle of Higher Education.recipe"
    "The Clinic.recipe"
    "The Conversation.recipe"
    "The Cult of Ghoul.recipe"
    "The Daily Mail.recipe"
    "The Daily Mirror.recipe"
    "The Daily Reckoning - US edition.recipe"
    "The Daily WTF.recipe"
    "The Diplomat.recipe"
    "The Economic Collapse.recipe"
    "The Economic Times India.recipe"
    "The Economic Times | Print Edition.recipe"
    "The Economist.recipe"
    "The Economist - Search.recipe"
    "The Economist Espresso.recipe"
    "The Economist News.recipe"
    "The Economist World Ahead.recipe"
    "The Epoch Times.recipe"
    "The Federalist.recipe"
    "The Friday Times.recipe"
    "The Galaxy's Edge.recipe"
    "The Gamer.recipe"
    "The Globe and Mail.recipe"
    "The Guardian and The Observer.recipe"
    "The Healthy from Readers Digest.recipe"
    "The Hindu.recipe"
    "The Hindu (Feeds).recipe"
    "The Hindu BusinessLine.recipe"
    "The Independent.recipe"
    "The India Forum.recipe"
    "The Insider.recipe"
    "The Irish Times.recipe"
    "The Irish Times (free).recipe"
    "The Japan Times.recipe"
    "The MIT Press Reader.recipe"
    "The Mainichi.recipe"
    "The Miami Herald.recipe"
    "The Monthly.recipe"
    "The Moscow Times.recipe"
    "The Moscow Times (light version).recipe"
    "The Nation.recipe"
    "The New Criterion.recipe"
    "The New Republic Magazine.recipe"
    "The New Times.recipe"
    "The New York Times.recipe"
    "The New York Times (Web).recipe"
    "The New Yorker Magazine.recipe"
    "The News Minute.recipe"
    "The ONE.recipe"
    "The Observer.recipe"
    "The Old New Thing.recipe"
    "The Oldie Online 2025-01.recipe"
    "The Online Photographer.recipe"
    "The Paris Review Blog.recipe"
    "The Past\: Ancient Egypt Magazine.recipe"
    "The Past\: Current World Archaeology.recipe"
    "The Past\: Military History Matters.recipe"
    "The Past\: Minerva Magazine.recipe"
    "The Philippine Daily Inquirer.recipe"
    "The Print.recipe"
    "The Public Domain Review.recipe"
    "The Register.recipe"
    "The Richest.recipe"
    "The Saturday Paper.recipe"
    "The Seattle Times.recipe"
    "The Skeptic.recipe"
    "The Skeptical Inquirer.recipe"
    "The Sportster.recipe"
    "The Standard.recipe"
    "The Straits Times.recipe"
    "The Sun UK.recipe"
    "The Sydney Morning Herald.recipe"
    "The TMZ.recipe"
    "The Things.recipe"
    "The Times and Sunday Times.recipe"
    "The Times of India.recipe"
    "The Toronto Star.recipe"
    "The Travel.recipe"
    "The Unz Review.recipe"
    "The Verge.recipe"
    "The Wall Street Journal.recipe"
    "The Wall Street Journal (free).recipe"
    "The Walrus Mag.recipe"
    "The Washington Post.recipe"
    "The Washington Post | Print Edition.recipe"
    "The Week.recipe"
    "The Wire.recipe"
    "The eBook Reader.recipe"
    "TheAtlantic.com.recipe"
    "TheJournal.ie.recipe"
    "TheMarker.recipe"
    "ThePressProject.recipe"
    "Tillsonburg/Norfolk County.recipe"
    "Times Literary Supplement.recipe"
    "Times of Malta.recipe"
    "Titanic.recipe"
    "To Vima.recipe"
    "Top Speed.recipe"
    "Trouw.recipe"
    "Tulsa World.recipe"
    "Tweakers.net.recipe"
    "Tyden.cz.recipe"
    "Tölzer Kurier.recipe"
    "UA-Футбол.recipe"
    "UNIAN.recipe"
    "US & World Report news.recipe"
    "USA Today.recipe"
    "Ugeskriftet.recipe"
    "UkrInform (Deutsch).recipe"
    "UkrInform (English).recipe"
    "UkrInform (Español).recipe"
    "UkrInform (Français).recipe"
    "UkrInform (polska).recipe"
    "Ukrainska Pravda.recipe"
    "Uncrate.recipe"
    "Uni secret base.recipe"
    "United Nations.recipe"
    "United Press International.recipe"
    "Universe Today.recipe"
    "VOX.recipe"
    "Vancouver Province.recipe"
    "Vancouver Sun.recipe"
    "Variety.recipe"
    "Vecernje Novosti.recipe"
    "Vecernji List.recipe"
    "Version2.dk.recipe"
    "Victoria Times Colonist.recipe"
    "Vignette.recipe"
    "Village Voice.recipe"
    "Vitalia.recipe"
    "Volkskrant.recipe"
    "Vreme.recipe"
    "WNP.recipe"
    "WOZ Die Wochenzeitung.recipe"
    "WSJ News.recipe"
    "WSJ. Magazine.recipe"
    "Walla.recipe"
    "Warentest.recipe"
    "Washington Times.recipe"
    "Weblogs SL (Xataka, Genbeta, VidaExtra, Blog de Cine y otros).recipe"
    "Weilheimer Tagblatt.recipe"
    "Welt der Physik.recipe"
    "Weltonline.recipe"
    "Wicomix.recipe"
    "Windsor Star.recipe"
    "Winnipeg Free Press.recipe"
    "Wired Daily Edition.recipe"
    "Wired Magazine, Monthly Edition.recipe"
    "Wirtualnemedia.pl.recipe"
    "Wonderzine.recipe"
    "Words Without Borders.recipe"
    "Worldcrunch.recipe"
    "XDA.recipe"
    "Yahoo News.recipe"
    "Yalansavar.recipe"
    "Yenişafak Gazetesi.recipe"
    "Ynet.recipe"
    "Yomiuri Online (World).recipe"
    "ZDNet.fr.recipe"
    "ZNetwork.recipe"
    "ZackZack.at.recipe"
    "Zeit Online.recipe"
    "Zero Hedge.recipe"
    "Ziarul Financiar.recipe"
    "Ziua Veche.recipe"
    "ZnadPlanszy.pl.recipe"
    "aktualne.cz.recipe"
    "attac.es.recipe"
    "denik.cz.recipe"
    "derStandard.recipe"
    "dev.ua.recipe"
    "dzieje.pl.recipe"
    "elDiario.es.recipe"
    "elEconomista.es.recipe"
    "heise.recipe"
    "iDnes.cz.recipe"
    "iProfesional.com.recipe"
    "iX.recipe"
    "iXBT.com.recipe"
    "il Cambiamento.recipe"
    "in.gr.recipe"
    "kath.net.recipe"
    "lwn.recipe"
    "newz.dk.recipe"
    "novinky.cz.recipe"
    "nrcnext.recipe"
    "nrc•next.recipe"
    "opindia.recipe"
    "optyczne.pl.recipe"
    "ppe.pl.recipe"
    "prekshaa.recipe"
    "soL Haber.recipe"
    "t3n.de News.recipe"
    "wenxuecity - znjy.recipe"
    "xkcd.recipe"
    "«Агентство».recipe"
    "Între fete.recipe"
    "ČT24.recipe"
    "České Noviny.recipe"
    "İktibas.recipe"
    "İnsan Okur.recipe"
    "Świat Czytników.recipe"
    "Świat Obrazu.recipe"
    "Życie Warszawy.recipe"
    "Știință şi Tehnică.recipe"
    "Інтерфакс-Україна.recipe"
    "Алексей Навальный.recipe"
    "Аргументы и Факты - aif.ru.recipe"
    "Беллингкэт (bell¿ngcat).recipe"
    "Беллінгкет (bell¿ngcat).recipe"
    "Бумага.recipe"
    "Важные истории.recipe"
    "Ведомости.recipe"
    "Викна-новости.recipe"
    "Вёрстка.recipe"
    "Вікна-новини.recipe"
    "Горький.recipe"
    "Грани.Ру.recipe"
    "Дзеркало тижня. Україна.recipe"
    "Довод.recipe"
    "Задолба!ли.recipe"
    "Зеркало.recipe"
    "Зеркало недели. Украина.recipe"
    "Идеальный пиксель.recipe"
    "Интерфакс-Украина.recipe"
    "Кедр.recipe"
    "Компьютерра.recipe"
    "ЛІГА.net.recipe"
    "ЛІГА.net (UA).recipe"
    "Люди Байкала.recipe"
    "МедиаЗона.recipe"
    "Мел.recipe"
    "НВ («Новий Час»).recipe"
    "НВ («Новое время»).recipe"
    "Настоящее время.recipe"
    "Новая Газета. Европа.recipe"
    "Новая вкладка.recipe"
    "Новый Калининград.recipe"
    "Нож.recipe"
    "ОВД-Инфо.recipe"
    "Освіта.ua.recipe"
    "Печат.recipe"
    "Полигон.recipe"
    "Правда.recipe"
    "Продолжение следует.recipe"
    "Проект.recipe"
    "РБК-Украина.recipe"
    "РБК-Україна.recipe"
    "Радіо Свобода.recipe"
    "Росбалт.recipe"
    "Сноб.recipe"
    "Собака.ru.recipe"
    "Собеседник.recipe"
    "Тайга.инфо.recipe"
    "Такие дела.recipe"
    "Теплица социальных технологий.recipe"
    "Троицкий вариант.recipe"
    "УНІАН.recipe"
    "УНИАН .recipe"
    "Украинская правда.recipe"
    "Украинские Национальные Новости.recipe"
    "Українська правда.recipe"
    "Українські Національні Новини.recipe"
    "Укринформ.recipe"
    "Укрінформ.recipe"
    "Фонтанка.recipe"
    "Хабр.recipe"
    "Черта.recipe"
    "ЭХО.recipe"
    "المصري اليوم (Al-Masry Alyoum).recipe"
    "दैनिक भास्कर.recipe"
    "हिंदुस्तान.recipe"
    "இந்து தமிழ் திசை.recipe"
    "ఆంధ్రజ్యోతి - ఆంధ్రప్రదేశ్.recipe"
    "ఆంధ్రజ్యోతి - తెలంగాణ.recipe"
    "ఈనాడు - ఆంధ్రప్రదేశ్.recipe"
    "ఈనాడు - తెలంగాణ.recipe"
    "ウクルインフォルム（UkrInform）.recipe"
    "人民日报.recipe"
    "南方周末.recipe"
    "日本経済新聞（朝刊・夕刊）.recipe"
    "星島日報 (香港).recipe"
    "時事通信.recipe"
    "毎日新聞.recipe"
    "毎日新聞(Science).recipe"
    "联合早报网 zaobao.com.recipe"
    "自由電子報.recipe"
    "동아일보.recipe"
    "미디어 다음 오늘의 주요 뉴스.recipe"
  ); _describe -t recipes "ebook-convert builtin recipes" extras
  _files -g "*.AZW *.AZW3 *.AZW4 *.CB7 *.CBC *.CBR *.CBZ *.CHM *.DJV *.DJVU *.DOCM *.DOCX *.DOWNLOADED_RECIPE *.EPUB *.FB2 *.FBZ *.HTM *.HTML *.HTMLZ *.LIT *.LRF *.MARKDOWN *.MD *.MOBI *.ODT *.OEBZIP *.OPF *.PDB *.PDF *.PML *.PMLZ *.POBI *.PRC *.RAR *.RB *.RECIPE *.RTF *.SHTM *.SHTML *.SNB *.TCR *.TEXT *.TEXTILE *.TXT *.TXTZ *.UPDB *.XHTM *.XHTML *.ZIP *.azw *.azw3 *.azw4 *.cb7 *.cbc *.cbr *.cbz *.chm *.djv *.djvu *.docm *.docx *.downloaded_recipe *.epub *.fb2 *.fbz *.htm *.html *.htmlz *.lit *.lrf *.markdown *.md *.mobi *.odt *.oebzip *.opf *.pdb *.pdf *.pml *.pmlz *.pobi *.prc *.rar *.rb *.recipe *.rtf *.shtm *.shtml *.snb *.tcr *.text *.textile *.txt *.txtz *.updb *.xhtm *.xhtml *.zip"
}

_ebc_output_args() {
  local extras; extras=(
    ".azw3:Convert to a .azw3 file with the same name as the input file"
    ".docx:Convert to a .docx file with the same name as the input file"
    ".epub:Convert to a .epub file with the same name as the input file"
    ".fb2:Convert to a .fb2 file with the same name as the input file"
    ".htmlz:Convert to a .htmlz file with the same name as the input file"
    ".lit:Convert to a .lit file with the same name as the input file"
    ".lrf:Convert to a .lrf file with the same name as the input file"
    ".mobi:Convert to a .mobi file with the same name as the input file"
    ".oeb:Convert to a .oeb file with the same name as the input file"
    ".pdb:Convert to a .pdb file with the same name as the input file"
    ".pdf:Convert to a .pdf file with the same name as the input file"
    ".pmlz:Convert to a .pmlz file with the same name as the input file"
    ".rb:Convert to a .rb file with the same name as the input file"
    ".rtf:Convert to a .rtf file with the same name as the input file"
    ".snb:Convert to a .snb file with the same name as the input file"
    ".tcr:Convert to a .tcr file with the same name as the input file"
    ".txt:Convert to a .txt file with the same name as the input file"
    ".txtz:Convert to a .txtz file with the same name as the input file"
    ".zip:Convert to a .zip file with the same name as the input file"
  ); _describe -t output "ebook-convert output" extras
  _files -g "*.AZW3 *.DOCX *.EPUB *.FB2 *.HTMLZ *.LIT *.LRF *.MOBI *.OEB *.PDB *.PDF *.PMLZ *.RB *.RTF *.SNB *.TCR *.TXT *.TXTZ *.ZIP *.azw3 *.docx *.epub *.fb2 *.htmlz *.lit *.lrf *.mobi *.oeb *.pdb *.pdf *.pmlz *.rb *.rtf *.snb *.tcr *.txt *.txtz *.zip"
  _path_files -/
}

_ebc_common_opts() {
  _arguments -s \
  '(- *)'--version"[show program's version number and exit]" \
  '(- *)'{--help,-h}"[show this help message and exit]" \
  --list-recipes"[List builtin recipe names. You can create an e-book from a builtin recipe like this\: ebook-convert 'Recipe Name.recipe' output.epub]" \
  --input-profile="[Specify the input profile. The input profile gives the conversion system information on how to interpret various information in the input document. For example resolution dependent lengths (i.e. lengths in pixels). Choices are\: cybookg3, cybook_opus, default, hanlinv3, hanlinv5, illiad, irexdr1000, irexdr800, kindle, msreader, mobipocket, nook, sony, sony300, sony900]":"Specify the input profile. The input profile gives the conversion system information on how to interpret various information in the input document. For example resolution dependent lengths (i.e. lengths in pixels). Choices are\: cybookg3, cybook_opus, default, hanlinv3, hanlinv5, illiad, irexdr1000, irexdr800, kindle, msreader, mobipocket, nook, sony, sony300, sony900":(cybookg3|cybook_opus|default|hanlinv3|hanlinv5|illiad|irexdr1000|irexdr800|kindle|msreader|mobipocket|nook|sony|sony300|sony900) \
  --output-profile="[Specify the output profile. The output profile tells the conversion system how to optimize the created document for the specified device. In some cases, an output profile can be used to optimize the output for a particular device, but this is rarely necessary. Choices are\:cybookg3, cybook_opus, default, generic_eink, generic_eink_hd, generic_eink_large, hanlinv3, hanlinv5, illiad, ipad, ipad3, irexdr1000, irexdr800, jetbook5, kindle, kindle_dx, kindle_fire, kindle_oasis, kindle_pw, kindle_pw3, kindle_scribe, kindle_voyage, kobo, msreader, mobipocket, nook, nook_color, nook_hd_plus, pocketbook_inkpad3, pocketbook_lux, pocketbook_hd, pocketbook_900, pocketbook_pro_912, galaxy, sony, sony300, sony900, sony-landscape, sonyt3, tablet]":"Specify the output profile. The output profile tells the conversion system how to optimize the created document for the specified device. In some cases, an output profile can be used to optimize the output for a particular device, but this is rarely necessary. Choices are\:cybookg3, cybook_opus, default, generic_eink, generic_eink_hd, generic_eink_large, hanlinv3, hanlinv5, illiad, ipad, ipad3, irexdr1000, irexdr800, jetbook5, kindle, kindle_dx, kindle_fire, kindle_oasis, kindle_pw, kindle_pw3, kindle_scribe, kindle_voyage, kobo, msreader, mobipocket, nook, nook_color, nook_hd_plus, pocketbook_inkpad3, pocketbook_lux, pocketbook_hd, pocketbook_900, pocketbook_pro_912, galaxy, sony, sony300, sony900, sony-landscape, sonyt3, tablet":(cybookg3|cybook_opus|default|generic_eink|generic_eink_hd|generic_eink_large|hanlinv3|hanlinv5|illiad|ipad|ipad3|irexdr1000|irexdr800|jetbook5|kindle|kindle_dx|kindle_fire|kindle_oasis|kindle_pw|kindle_pw3|kindle_scribe|kindle_voyage|kobo|msreader|mobipocket|nook|nook_color|nook_hd_plus|pocketbook_inkpad3|pocketbook_lux|pocketbook_hd|pocketbook_900|pocketbook_pro_912|galaxy|sony|sony300|sony900|sony-landscape|sonyt3|tablet) \
  --base-font-size="[The base font size in pts. All font sizes in the produced book will be rescaled based on this size. By choosing a larger size you can make the fonts in the output bigger and vice versa. By default, when the value is zero, the base font size is chosen based on the output profile you chose.]":"The base font size in pts. All font sizes in the produced book will be rescaled based on this size. By choosing a larger size you can make the fonts in the output bigger and vice versa. By default, when the value is zero, the base font size is chosen based on the output profile you chose.": \
  --disable-font-rescaling"[Disable all rescaling of font sizes.]" \
  --font-size-mapping="[Mapping from CSS font names to font sizes in pts. An example setting is 12,12,14,16,18,20,22,24. These are the mappings for the sizes xx-small to xx-large, with the final size being for huge fonts. The font rescaling algorithm uses these sizes to intelligently rescale fonts. The default is to use a mapping based on the output profile you chose.]":"Mapping from CSS font names to font sizes in pts. An example setting is 12,12,14,16,18,20,22,24. These are the mappings for the sizes xx-small to xx-large, with the final size being for huge fonts. The font rescaling algorithm uses these sizes to intelligently rescale fonts. The default is to use a mapping based on the output profile you chose.": \
  --embed-font-family="[Embed the specified font family into the book. This specifies the 'base' font used for the book. If the input document specifies its own fonts, they may override this base font. You can use the filter style information option to remove fonts from the input document. Note that font embedding only works with some output formats, principally EPUB, AZW3 and DOCX.]":"Embed the specified font family into the book. This specifies the 'base' font used for the book. If the input document specifies its own fonts, they may override this base font. You can use the filter style information option to remove fonts from the input document. Note that font embedding only works with some output formats, principally EPUB, AZW3 and DOCX.": \
  --subset-embedded-fonts"[Subset all embedded fonts. Every embedded font is reduced to contain only the glyphs used in this document. This decreases the size of the font files. Useful if you are embedding a particularly large font with lots of unused glyphs.]" \
  --embed-all-fonts"[Embed every font that is referenced in the input document but not already embedded. This will search your system for the fonts, and if found, they will be embedded. Embedding will only work if the format you are converting to supports embedded fonts, such as EPUB, AZW3, DOCX or PDF. Please ensure that you have the proper license for embedding the fonts used in this document.]" \
  --line-height="[The line height in pts. Controls spacing between consecutive lines of text. Only applies to elements that do not define their own line height. In most cases, the minimum line height option is more useful. By default no line height manipulation is performed.]":"The line height in pts. Controls spacing between consecutive lines of text. Only applies to elements that do not define their own line height. In most cases, the minimum line height option is more useful. By default no line height manipulation is performed.": \
  --minimum-line-height="[The minimum line height, as a percentage of the element's calculated font size. calibre will ensure that every element has a line height of at least this setting, irrespective of what the input document specifies. Set to zero to disable. Default is 120%. Use this setting in preference to the direct line height specification, unless you know what you are doing. For example, you can achieve 'double spaced' text by setting this to 240.]":"The minimum line height, as a percentage of the element's calculated font size. calibre will ensure that every element has a line height of at least this setting, irrespective of what the input document specifies. Set to zero to disable. Default is 120%. Use this setting in preference to the direct line height specification, unless you know what you are doing. For example, you can achieve 'double spaced' text by setting this to 240.": \
  --linearize-tables"[Some badly designed documents use tables to control the layout of text on the page. When converted these documents often have text that runs off the page and other artifacts. This option will extract the content from the tables and present it in a linear fashion.]" \
  --transform-html-rules="[Path to a file containing rules to transform the HTML in this book. The easiest way to create such a file is to use the wizard for creating rules in the calibre GUI. Access it in the 'Look & feel->Transform HTML' section of the conversion dialog. Once you create the rules, you can use the 'Export' button to save them to a file.]":"Path to a file containing rules to transform the HTML in this book. The easiest way to create such a file is to use the wizard for creating rules in the calibre GUI. Access it in the 'Look & feel->Transform HTML' section of the conversion dialog. Once you create the rules, you can use the 'Export' button to save them to a file.": \
  --extra-css="[Either the path to a CSS stylesheet or raw CSS. This CSS will be appended to the style rules from the source file, so it can be used to override those rules.]":"Either the path to a CSS stylesheet or raw CSS. This CSS will be appended to the style rules from the source file, so it can be used to override those rules.": \
  --filter-css="[A comma separated list of CSS properties that will be removed from all CSS style rules. This is useful if the presence of some style information prevents it from being overridden on your device. For example\: font-family,color,margin-left,margin-right]":"A comma separated list of CSS properties that will be removed from all CSS style rules. This is useful if the presence of some style information prevents it from being overridden on your device. For example\: font-family,color,margin-left,margin-right": \
  --transform-css-rules="[Path to a file containing rules to transform the CSS styles in this book. The easiest way to create such a file is to use the wizard for creating rules in the calibre GUI. Access it in the 'Look & feel->Transform styles' section of the conversion dialog. Once you create the rules, you can use the 'Export' button to save them to a file.]":"Path to a file containing rules to transform the CSS styles in this book. The easiest way to create such a file is to use the wizard for creating rules in the calibre GUI. Access it in the 'Look & feel->Transform styles' section of the conversion dialog. Once you create the rules, you can use the 'Export' button to save them to a file.": \
  --expand-css"[By default, calibre will use the shorthand form for various CSS properties such as margin, padding, border, etc. This option will cause it to use the full expanded form instead. Note that CSS is always expanded when generating EPUB files with the output profile set to one of the Nook profiles as the Nook cannot handle shorthand CSS.]" \
  --smarten-punctuation"[Convert plain quotes, dashes and ellipsis to their typographically correct equivalents. For details, see https\://daringfireball.net/projects/smartypants.]" \
  --unsmarten-punctuation"[Convert fancy quotes, dashes and ellipsis to their plain equivalents.]" \
  --margin-top="[Set the top margin in pts. Default is 5.0. Setting this to less than zero will cause no margin to be set (the margin setting in the original document will be preserved). Note\: Page oriented formats such as PDF and DOCX have their own margin settings that take precedence.]":"Set the top margin in pts. Default is 5.0. Setting this to less than zero will cause no margin to be set (the margin setting in the original document will be preserved). Note\: Page oriented formats such as PDF and DOCX have their own margin settings that take precedence.": \
  --margin-left="[Set the left margin in pts. Default is 5.0. Setting this to less than zero will cause no margin to be set (the margin setting in the original document will be preserved). Note\: Page oriented formats such as PDF and DOCX have their own margin settings that take precedence.]":"Set the left margin in pts. Default is 5.0. Setting this to less than zero will cause no margin to be set (the margin setting in the original document will be preserved). Note\: Page oriented formats such as PDF and DOCX have their own margin settings that take precedence.": \
  --margin-right="[Set the right margin in pts. Default is 5.0. Setting this to less than zero will cause no margin to be set (the margin setting in the original document will be preserved). Note\: Page oriented formats such as PDF and DOCX have their own margin settings that take precedence.]":"Set the right margin in pts. Default is 5.0. Setting this to less than zero will cause no margin to be set (the margin setting in the original document will be preserved). Note\: Page oriented formats such as PDF and DOCX have their own margin settings that take precedence.": \
  --margin-bottom="[Set the bottom margin in pts. Default is 5.0. Setting this to less than zero will cause no margin to be set (the margin setting in the original document will be preserved). Note\: Page oriented formats such as PDF and DOCX have their own margin settings that take precedence.]":"Set the bottom margin in pts. Default is 5.0. Setting this to less than zero will cause no margin to be set (the margin setting in the original document will be preserved). Note\: Page oriented formats such as PDF and DOCX have their own margin settings that take precedence.": \
  --change-justification="[Change text justification. A value of 'left' converts all justified text in the source to left aligned (i.e. unjustified) text. A value of 'justify' converts all unjustified text to justified. A value of 'original' (the default) does not change justification in the source file. Note that only some output formats support justification.]":"Change text justification. A value of 'left' converts all justified text in the source to left aligned (i.e. unjustified) text. A value of 'justify' converts all unjustified text to justified. A value of 'original' (the default) does not change justification in the source file. Note that only some output formats support justification.":(left|justify|original) \
  --insert-blank-line"[Insert a blank line between paragraphs. Will not work if the source file does not use paragraphs (<p> or <div> tags).]" \
  --insert-blank-line-size="[Set the height of the inserted blank lines (in em). The height of the lines between paragraphs will be twice the value set here.]":"Set the height of the inserted blank lines (in em). The height of the lines between paragraphs will be twice the value set here.": \
  --remove-paragraph-spacing"[Remove spacing between paragraphs. Also sets an indent on paragraphs of 1.5em. Spacing removal will not work if the source file does not use paragraphs (<p> or <div> tags).]" \
  --remove-paragraph-spacing-indent-size="[When calibre removes blank lines between paragraphs, it automatically sets a paragraph indent, to ensure that paragraphs can be easily distinguished. This option controls the width of that indent (in em). If you set this value negative, then the indent specified in the input document is used, that is, calibre does not change the indentation.]":"When calibre removes blank lines between paragraphs, it automatically sets a paragraph indent, to ensure that paragraphs can be easily distinguished. This option controls the width of that indent (in em). If you set this value negative, then the indent specified in the input document is used, that is, calibre does not change the indentation.": \
  --asciiize"[Transliterate Unicode characters to an ASCII representation. Use with care because this will replace Unicode characters with ASCII. For instance it will replace 'Pelé' with 'Pele'. Also, note that in cases where there are multiple representations of a character (characters shared by Chinese and Japanese for instance) the representation based on the current calibre interface language will be used.]" \
  --keep-ligatures"[Preserve ligatures present in the input document. A ligature is a combined character of a pair of characters like ff, fi, fl et cetera. Most readers do not have support for ligatures in their default fonts, so they are unlikely to render correctly. By default, calibre will turn a ligature into the corresponding pair of normal characters. Note that ligatures here mean only unicode ligatures not ligatures created via CSS or font styles. This option will preserve them instead.]" \
  --enable-heuristics"[Enable heuristic processing. This option must be set for any heuristic processing to take place.]" \
  --disable-markup-chapter-headings"[Detect unformatted chapter headings and sub headings. Change them to h2 and h3 tags.  This setting will not create a TOC, but can be used in conjunction with structure detection to create one.]" \
  --disable-italicize-common-cases"[Look for common words and patterns that denote italics and italicize them.]" \
  --disable-fix-indents"[Turn indentation created from multiple non-breaking space entities into CSS indents.]" \
  --html-unwrap-factor="[Scale used to determine the length at which a line should be unwrapped. Valid values are a decimal between 0 and 1. The default is 0.4, just below the median line length.  If only a few lines in the document require unwrapping this value should be reduced]":"Scale used to determine the length at which a line should be unwrapped. Valid values are a decimal between 0 and 1. The default is 0.4, just below the median line length.  If only a few lines in the document require unwrapping this value should be reduced": \
  --disable-unwrap-lines"[Unwrap lines using punctuation and other formatting clues.]" \
  --disable-delete-blank-paragraphs"[Remove empty paragraphs from the document when they exist between every other paragraph]" \
  --disable-format-scene-breaks"[Left aligned scene break markers are center aligned. Replace soft scene breaks that use multiple blank lines with horizontal rules.]" \
  --disable-dehyphenate"[Analyze hyphenated words throughout the document.  The document itself is used as a dictionary to determine whether hyphens should be retained or removed.]" \
  --disable-renumber-headings"[Looks for occurrences of sequential <h1> or <h2> tags. The tags are renumbered to prevent splitting in the middle of chapter headings.]" \
  --replace-scene-breaks="[Replace scene breaks with the specified text. By default, the text from the input document is used.]":"Replace scene breaks with the specified text. By default, the text from the input document is used.": \
  --sr1-search="[Search pattern (regular expression) to be replaced with sr1-replace.]":"Search pattern (regular expression) to be replaced with sr1-replace.": \
  --sr1-replace="[Replacement to replace the text found with sr1-search.]":"Replacement to replace the text found with sr1-search.": \
  --sr2-search="[Search pattern (regular expression) to be replaced with sr2-replace.]":"Search pattern (regular expression) to be replaced with sr2-replace.": \
  --sr2-replace="[Replacement to replace the text found with sr2-search.]":"Replacement to replace the text found with sr2-search.": \
  --sr3-search="[Search pattern (regular expression) to be replaced with sr3-replace.]":"Search pattern (regular expression) to be replaced with sr3-replace.": \
  --sr3-replace="[Replacement to replace the text found with sr3-search.]":"Replacement to replace the text found with sr3-search.": \
  --search-replace="[Path to a file containing search and replace regular expressions. The file must contain alternating lines of regular expression followed by replacement pattern (which can be an empty line). The regular expression must be in the Python regex syntax and the file must be UTF-8 encoded.]":"Path to a file containing search and replace regular expressions. The file must contain alternating lines of regular expression followed by replacement pattern (which can be an empty line). The regular expression must be in the Python regex syntax and the file must be UTF-8 encoded.":_files \
  --chapter="[An XPath expression to detect chapter titles. The default is to consider <h1> or <h2> tags that contain the words 'chapter', 'book', 'section', 'prologue', 'epilogue' or 'part' as chapter titles as well as any tags that have class='chapter'. The expression used must evaluate to a list of elements. To disable chapter detection, use the expression '/'. See the XPath Tutorial in the calibre User Manual for further help on using this feature.]":"An XPath expression to detect chapter titles. The default is to consider <h1> or <h2> tags that contain the words 'chapter', 'book', 'section', 'prologue', 'epilogue' or 'part' as chapter titles as well as any tags that have class='chapter'. The expression used must evaluate to a list of elements. To disable chapter detection, use the expression '/'. See the XPath Tutorial in the calibre User Manual for further help on using this feature.": \
  --chapter-mark="[Specify how to mark detected chapters. A value of 'pagebreak' will insert page breaks before chapters. A value of 'rule' will insert a line before chapters. A value of 'none' will disable chapter marking and a value of 'both' will use both page breaks and lines to mark chapters.]":"Specify how to mark detected chapters. A value of 'pagebreak' will insert page breaks before chapters. A value of 'rule' will insert a line before chapters. A value of 'none' will disable chapter marking and a value of 'both' will use both page breaks and lines to mark chapters.":(pagebreak|rule|both|none) \
  --prefer-metadata-cover"[Use the cover detected from the source file in preference to the specified cover.]" \
  --remove-first-image"[Remove the first image from the input e-book. Useful if the input document has a cover image that is not identified as a cover. In this case, if you set a cover in calibre, the output document will end up with two cover images if you do not specify this option.]" \
  --insert-metadata"[Insert the book metadata at the start of the book. This is useful if your e-book reader does not support displaying/searching metadata directly.]" \
  --page-breaks-before="[An XPath expression. Page breaks are inserted before the specified elements. To disable use the expression\: /]":"An XPath expression. Page breaks are inserted before the specified elements. To disable use the expression\: /": \
  --disable-remove-fake-margins"[Some documents specify page margins by specifying a left and right margin on each individual paragraph. calibre will try to detect and remove these margins. Sometimes, this can cause the removal of margins that should not have been removed. In this case you can disable the removal.]" \
  --start-reading-at="[An XPath expression to detect the location in the document at which to start reading. Some e-book reading programs (most prominently the Kindle) use this location as the position at which to open the book. See the XPath tutorial in the calibre User Manual for further help using this feature.]":"An XPath expression to detect the location in the document at which to start reading. Some e-book reading programs (most prominently the Kindle) use this location as the position at which to open the book. See the XPath tutorial in the calibre User Manual for further help using this feature.": \
  --add-alt-text-to-img"[When an <img> tag has no alt attribute, check the associated image file for metadata that specifies alternate text, and use it to fill in the alt attribute. The alt attribute is used by screen readers for assisting the visually challenged.]" \
  --level1-toc="[XPath expression that specifies all tags that should be added to the Table of Contents at level one. If this is specified, it takes precedence over other forms of auto-detection. See the XPath Tutorial in the calibre User Manual for examples.]":"XPath expression that specifies all tags that should be added to the Table of Contents at level one. If this is specified, it takes precedence over other forms of auto-detection. See the XPath Tutorial in the calibre User Manual for examples.": \
  --level2-toc="[XPath expression that specifies all tags that should be added to the Table of Contents at level two. Each entry is added under the previous level one entry. See the XPath Tutorial in the calibre User Manual for examples.]":"XPath expression that specifies all tags that should be added to the Table of Contents at level two. Each entry is added under the previous level one entry. See the XPath Tutorial in the calibre User Manual for examples.": \
  --level3-toc="[XPath expression that specifies all tags that should be added to the Table of Contents at level three. Each entry is added under the previous level two entry. See the XPath Tutorial in the calibre User Manual for examples.]":"XPath expression that specifies all tags that should be added to the Table of Contents at level three. Each entry is added under the previous level two entry. See the XPath Tutorial in the calibre User Manual for examples.": \
  --toc-threshold="[If fewer than this number of chapters is detected, then links are added to the Table of Contents. Default\: 6]":"If fewer than this number of chapters is detected, then links are added to the Table of Contents. Default\: 6": \
  --max-toc-links="[Maximum number of links to insert into the TOC. Set to 0 to disable. Default is\: 50. Links are only added to the TOC if less than the threshold number of chapters were detected.]":"Maximum number of links to insert into the TOC. Set to 0 to disable. Default is\: 50. Links are only added to the TOC if less than the threshold number of chapters were detected.": \
  --no-chapters-in-toc"[Don't add auto-detected chapters to the Table of Contents.]" \
  --use-auto-toc"[Normally, if the source file already has a Table of Contents, it is used in preference to the auto-generated one. With this option, the auto-generated one is always used.]" \
  --toc-filter="[Remove entries from the Table of Contents whose titles match the specified regular expression. Matching entries and all their children are removed.]":"Remove entries from the Table of Contents whose titles match the specified regular expression. Matching entries and all their children are removed.": \
  --duplicate-links-in-toc"[When creating a TOC from links in the input document, allow duplicate entries, i.e. allow more than one entry with the same text, provided that they point to a different location.]" \
  --title="[Set the title.]":"Set the title.": \
  --authors="[Set the authors. Multiple authors should be separated by ampersands.]":"Set the authors. Multiple authors should be separated by ampersands.": \
  --title-sort="[The version of the title to be used for sorting. ]":"The version of the title to be used for sorting. ": \
  --author-sort="[String to be used when sorting by author. ]":"String to be used when sorting by author. ": \
  --cover="[Set the cover to the specified file or URL]":"Set the cover to the specified file or URL":'_files -g "*.BMP *.GIF *.JPEG *.JPG *.PNG *.bmp *.gif *.jpeg *.jpg *.png"' \
  --comments="[Set the e-book description.]":"Set the e-book description.": \
  --publisher="[Set the e-book publisher.]":"Set the e-book publisher.": \
  --series="[Set the series this e-book belongs to.]":"Set the series this e-book belongs to.": \
  --series-index="[Set the index of the book in this series.]":"Set the index of the book in this series.": \
  --rating="[Set the rating. Should be a number between 1 and 5.]":"Set the rating. Should be a number between 1 and 5.": \
  --isbn="[Set the ISBN of the book.]":"Set the ISBN of the book.": \
  --tags="[Set the tags for the book. Should be a comma separated list.]":"Set the tags for the book. Should be a comma separated list.": \
  --book-producer="[Set the book producer.]":"Set the book producer.": \
  --language="[Set the language.]":"Set the language.": \
  --pubdate="[Set the publication date (assumed to be in the local timezone, unless the timezone is explicitly specified)]":"Set the publication date (assumed to be in the local timezone, unless the timezone is explicitly specified)": \
  --timestamp="[Set the book timestamp (no longer used anywhere)]":"Set the book timestamp (no longer used anywhere)": \
  {--read-metadata-from-opf=,--from-opf=,-m+}"[Read metadata from the specified OPF file. Metadata read from this file will override any metadata in the source file.]":"Read metadata from the specified OPF file. Metadata read from this file will override any metadata in the source file.": \
  {--verbose,-v}"[Level of verbosity. Specify multiple times for greater verbosity. Specifying it twice will result in full verbosity, once medium verbosity and zero times least verbosity.]" \
  {--debug-pipeline=,-d+}"[Save the output from different stages of the conversion pipeline to the specified folder. Useful if you are unsure at which stage of the conversion process a bug is occurring.]":"Save the output from different stages of the conversion pipeline to the specified folder. Useful if you are unsure at which stage of the conversion process a bug is occurring.":'_path_files -/' \
  --pretty-print"[If specified, the output plugin will try to create output that is as human readable as possible. May not have any effect for some output plugins.]" \
  --input-encoding="[Specify the character encoding of the input document. If set this option will override any encoding declared by the document itself. Particularly useful for documents that do not declare an encoding or that have erroneous encoding declarations.]":"Specify the character encoding of the input document. If set this option will override any encoding declared by the document itself. Particularly useful for documents that do not declare an encoding or that have erroneous encoding declarations.": 
}

_ebc_input_opts_cb7() {
  _arguments -s \
  --colors="[Reduce the number of colors used in the image. This works only if you choose the PNG output format. It is useful to reduce file sizes. Set to zero to turn off. Maximum value is 256. It is off by default.]":"Reduce the number of colors used in the image. This works only if you choose the PNG output format. It is useful to reduce file sizes. Set to zero to turn off. Maximum value is 256. It is off by default.": \
  --comic-image-size="[Specify the image size as width x height pixels, for example\: 123x321. Normally, an image size is automatically calculated from the output profile, this option overrides it.]":"Specify the image size as width x height pixels, for example\: 123x321. Normally, an image size is automatically calculated from the output profile, this option overrides it.": \
  --despeckle"[Enable Despeckle. Reduces speckle noise. May greatly increase processing time.]" \
  --disable-trim"[Disable trimming of comic pages. For some comics, trimming might remove content as well as borders.]" \
  --dont-add-comic-pages-to-toc"[When converting a CBC do not add links to each page to the TOC. Note this only applies if the TOC has more than one section]" \
  --dont-grayscale"[Do not convert the image to grayscale (black and white)]" \
  --dont-normalize"[Disable normalize (improve contrast) color range for pictures. Default\: False]" \
  --dont-sharpen"[Disable sharpening.]" \
  --keep-aspect-ratio"[Maintain picture aspect ratio. Default is to fill the screen.]" \
  --landscape"[Don't split landscape images into two portrait images]" \
  --no-process"[Apply no processing to the image]" \
  --no-sort"[Don't sort the files found in the comic alphabetically by name. Instead use the order they were added to the comic.]" \
  --output-format="[The format that images in the created e-book are converted to. You can experiment to see which format gives you optimal size and look on your device.]":"The format that images in the created e-book are converted to. You can experiment to see which format gives you optimal size and look on your device.":(png|jpg) \
  --right2left"[Used for right-to-left publications like manga. Causes landscape pages to be split into portrait pages from right to left.]" \
  --wide"[Keep aspect ratio and scale image using screen height as image width for viewing in landscape mode.]" 
}

_ebc_input_opts_cbc() {
  _arguments -s \
  --colors="[Reduce the number of colors used in the image. This works only if you choose the PNG output format. It is useful to reduce file sizes. Set to zero to turn off. Maximum value is 256. It is off by default.]":"Reduce the number of colors used in the image. This works only if you choose the PNG output format. It is useful to reduce file sizes. Set to zero to turn off. Maximum value is 256. It is off by default.": \
  --comic-image-size="[Specify the image size as width x height pixels, for example\: 123x321. Normally, an image size is automatically calculated from the output profile, this option overrides it.]":"Specify the image size as width x height pixels, for example\: 123x321. Normally, an image size is automatically calculated from the output profile, this option overrides it.": \
  --despeckle"[Enable Despeckle. Reduces speckle noise. May greatly increase processing time.]" \
  --disable-trim"[Disable trimming of comic pages. For some comics, trimming might remove content as well as borders.]" \
  --dont-add-comic-pages-to-toc"[When converting a CBC do not add links to each page to the TOC. Note this only applies if the TOC has more than one section]" \
  --dont-grayscale"[Do not convert the image to grayscale (black and white)]" \
  --dont-normalize"[Disable normalize (improve contrast) color range for pictures. Default\: False]" \
  --dont-sharpen"[Disable sharpening.]" \
  --keep-aspect-ratio"[Maintain picture aspect ratio. Default is to fill the screen.]" \
  --landscape"[Don't split landscape images into two portrait images]" \
  --no-process"[Apply no processing to the image]" \
  --no-sort"[Don't sort the files found in the comic alphabetically by name. Instead use the order they were added to the comic.]" \
  --output-format="[The format that images in the created e-book are converted to. You can experiment to see which format gives you optimal size and look on your device.]":"The format that images in the created e-book are converted to. You can experiment to see which format gives you optimal size and look on your device.":(png|jpg) \
  --right2left"[Used for right-to-left publications like manga. Causes landscape pages to be split into portrait pages from right to left.]" \
  --wide"[Keep aspect ratio and scale image using screen height as image width for viewing in landscape mode.]" 
}

_ebc_input_opts_cbr() {
  _arguments -s \
  --colors="[Reduce the number of colors used in the image. This works only if you choose the PNG output format. It is useful to reduce file sizes. Set to zero to turn off. Maximum value is 256. It is off by default.]":"Reduce the number of colors used in the image. This works only if you choose the PNG output format. It is useful to reduce file sizes. Set to zero to turn off. Maximum value is 256. It is off by default.": \
  --comic-image-size="[Specify the image size as width x height pixels, for example\: 123x321. Normally, an image size is automatically calculated from the output profile, this option overrides it.]":"Specify the image size as width x height pixels, for example\: 123x321. Normally, an image size is automatically calculated from the output profile, this option overrides it.": \
  --despeckle"[Enable Despeckle. Reduces speckle noise. May greatly increase processing time.]" \
  --disable-trim"[Disable trimming of comic pages. For some comics, trimming might remove content as well as borders.]" \
  --dont-add-comic-pages-to-toc"[When converting a CBC do not add links to each page to the TOC. Note this only applies if the TOC has more than one section]" \
  --dont-grayscale"[Do not convert the image to grayscale (black and white)]" \
  --dont-normalize"[Disable normalize (improve contrast) color range for pictures. Default\: False]" \
  --dont-sharpen"[Disable sharpening.]" \
  --keep-aspect-ratio"[Maintain picture aspect ratio. Default is to fill the screen.]" \
  --landscape"[Don't split landscape images into two portrait images]" \
  --no-process"[Apply no processing to the image]" \
  --no-sort"[Don't sort the files found in the comic alphabetically by name. Instead use the order they were added to the comic.]" \
  --output-format="[The format that images in the created e-book are converted to. You can experiment to see which format gives you optimal size and look on your device.]":"The format that images in the created e-book are converted to. You can experiment to see which format gives you optimal size and look on your device.":(png|jpg) \
  --right2left"[Used for right-to-left publications like manga. Causes landscape pages to be split into portrait pages from right to left.]" \
  --wide"[Keep aspect ratio and scale image using screen height as image width for viewing in landscape mode.]" 
}

_ebc_input_opts_cbz() {
  _arguments -s \
  --colors="[Reduce the number of colors used in the image. This works only if you choose the PNG output format. It is useful to reduce file sizes. Set to zero to turn off. Maximum value is 256. It is off by default.]":"Reduce the number of colors used in the image. This works only if you choose the PNG output format. It is useful to reduce file sizes. Set to zero to turn off. Maximum value is 256. It is off by default.": \
  --comic-image-size="[Specify the image size as width x height pixels, for example\: 123x321. Normally, an image size is automatically calculated from the output profile, this option overrides it.]":"Specify the image size as width x height pixels, for example\: 123x321. Normally, an image size is automatically calculated from the output profile, this option overrides it.": \
  --despeckle"[Enable Despeckle. Reduces speckle noise. May greatly increase processing time.]" \
  --disable-trim"[Disable trimming of comic pages. For some comics, trimming might remove content as well as borders.]" \
  --dont-add-comic-pages-to-toc"[When converting a CBC do not add links to each page to the TOC. Note this only applies if the TOC has more than one section]" \
  --dont-grayscale"[Do not convert the image to grayscale (black and white)]" \
  --dont-normalize"[Disable normalize (improve contrast) color range for pictures. Default\: False]" \
  --dont-sharpen"[Disable sharpening.]" \
  --keep-aspect-ratio"[Maintain picture aspect ratio. Default is to fill the screen.]" \
  --landscape"[Don't split landscape images into two portrait images]" \
  --no-process"[Apply no processing to the image]" \
  --no-sort"[Don't sort the files found in the comic alphabetically by name. Instead use the order they were added to the comic.]" \
  --output-format="[The format that images in the created e-book are converted to. You can experiment to see which format gives you optimal size and look on your device.]":"The format that images in the created e-book are converted to. You can experiment to see which format gives you optimal size and look on your device.":(png|jpg) \
  --right2left"[Used for right-to-left publications like manga. Causes landscape pages to be split into portrait pages from right to left.]" \
  --wide"[Keep aspect ratio and scale image using screen height as image width for viewing in landscape mode.]" 
}

_ebc_input_opts_docm() {
  _arguments -s \
  --docx-inline-subsup"[Render superscripts and subscripts so that they do not affect the line height]" \
  --docx-no-cover"[Normally, if a large image is present at the start of the document that looks like a cover, it will be removed from the document and used as the cover for created e-book. This option turns off that behavior.]" \
  --docx-no-pagebreaks-between-notes"[Do not insert a page break after every endnote.]" 
}

_ebc_input_opts_docx() {
  _arguments -s \
  --docx-inline-subsup"[Render superscripts and subscripts so that they do not affect the line height]" \
  --docx-no-cover"[Normally, if a large image is present at the start of the document that looks like a cover, it will be removed from the document and used as the cover for created e-book. This option turns off that behavior.]" \
  --docx-no-pagebreaks-between-notes"[Do not insert a page break after every endnote.]" 
}

_ebc_input_opts_downloaded_recipe() {
  _arguments -s \
  --dont-download-recipe"[Do not download latest version of builtin recipes from the calibre server]" \
  --lrf"[Optimize fetching for subsequent conversion to LRF.]" \
  --password="[Password for sites that require a login to access content.]":"Password for sites that require a login to access content.": \
  --recipe-specific-option="[Recipe specific options. Syntax is option_name\:value. For example\: --recipe-specific-option=date\:2030-11-31. Can be specified multiple times to set different options. To see a list of all available options for a recipe, use --recipe-specific-option=list.]":"Recipe specific options. Syntax is option_name\:value. For example\: --recipe-specific-option=date\:2030-11-31. Can be specified multiple times to set different options. To see a list of all available options for a recipe, use --recipe-specific-option=list.": \
  --test"[Useful for recipe development. Forces max_articles_per_feed to 2 and downloads at most 2 feeds. You can change the number of feeds and articles by supplying optional arguments. For example\: --test 3 1 will download at most 3 feeds and only 1 article per feed.]" \
  --username="[Username for sites that require a login to access content.]":"Username for sites that require a login to access content.": 
}

_ebc_input_opts_fb2() {
  _arguments -s \
  --no-inline-fb2-toc"[Do not insert a Table of Contents at the beginning of the book]" 
}

_ebc_input_opts_fbz() {
  _arguments -s \
  --no-inline-fb2-toc"[Do not insert a Table of Contents at the beginning of the book]" 
}

_ebc_input_opts_htm() {
  _arguments -s \
  --allow-local-files-outside-root"[Normally, resources linked to by the HTML file or its children will only be allowed if they are in a sub-folder of the original HTML file. This option allows including local files from any location on your computer. This can be a security risk if you are converting untrusted HTML and expecting to distribute the result of the conversion.]" \
  --breadth-first"[Traverse links in HTML files breadth first. Normally, they are traversed depth first.]" \
  --dont-package"[Normally this input plugin re-arranges all the input files into a standard folder hierarchy. Only use this option if you know what you are doing as it can result in various nasty side effects in the rest of the conversion pipeline.]" \
  --max-levels="[Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.]":"Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.": 
}

_ebc_input_opts_html() {
  _arguments -s \
  --allow-local-files-outside-root"[Normally, resources linked to by the HTML file or its children will only be allowed if they are in a sub-folder of the original HTML file. This option allows including local files from any location on your computer. This can be a security risk if you are converting untrusted HTML and expecting to distribute the result of the conversion.]" \
  --breadth-first"[Traverse links in HTML files breadth first. Normally, they are traversed depth first.]" \
  --dont-package"[Normally this input plugin re-arranges all the input files into a standard folder hierarchy. Only use this option if you know what you are doing as it can result in various nasty side effects in the rest of the conversion pipeline.]" \
  --max-levels="[Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.]":"Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.": 
}

_ebc_input_opts_markdown() {
  _arguments -s \
  --formatting-type="[Formatting used within the document. * auto\: Automatically decide which formatting processor to use * plain\: No formatting * heuristic\: Use heuristics to determine chapter headings, italics, etc. * textile\: Use the Textile markup language * markdown\: Use the Markdown markup language To learn more about Markdown see https\://daringfireball.net/projects/markdown/]":"Formatting used within the document. * auto\: Automatically decide which formatting processor to use * plain\: No formatting * heuristic\: Use heuristics to determine chapter headings, italics, etc. * textile\: Use the Textile markup language * markdown\: Use the Markdown markup language To learn more about Markdown see https\://daringfireball.net/projects/markdown/":(auto|plain|heuristic|textile|markdown) \
  --markdown-extensions="[Enable extensions to Markdown syntax. Extensions are formatting that is not part of the standard Markdown format. The extensions enabled by default\: footnotes, tables, toc. To learn more about Markdown extensions, see https\://python-markdown.github.io/extensions/ This should be a comma separated list of extensions to enable\: * abbr\: Abbreviations * admonition\: Support admonitions * attr_list\: Add attribute to HTML tags * codehilite\: Add code highlighting via Pygments * def_list\: Definition lists * extra\: Enables various common extensions * fenced_code\: Alternative code block syntax * footnotes\: Footnotes * legacy_attrs\: Use legacy element attributes * legacy_em\: Use legacy underscore handling for connected words * meta\: Metadata in the document * nl2br\: Treat newlines as hard breaks * sane_lists\: Do not allow mixing list types * smarty\: Use Markdown's internal smartypants parser * tables\: Support tables * toc\: Generate a table of contents * wikilinks\: Wiki style links]":"Enable extensions to Markdown syntax. Extensions are formatting that is not part of the standard Markdown format. The extensions enabled by default\: footnotes, tables, toc. To learn more about Markdown extensions, see https\://python-markdown.github.io/extensions/ This should be a comma separated list of extensions to enable\: * abbr\: Abbreviations * admonition\: Support admonitions * attr_list\: Add attribute to HTML tags * codehilite\: Add code highlighting via Pygments * def_list\: Definition lists * extra\: Enables various common extensions * fenced_code\: Alternative code block syntax * footnotes\: Footnotes * legacy_attrs\: Use legacy element attributes * legacy_em\: Use legacy underscore handling for connected words * meta\: Metadata in the document * nl2br\: Treat newlines as hard breaks * sane_lists\: Do not allow mixing list types * smarty\: Use Markdown's internal smartypants parser * tables\: Support tables * toc\: Generate a table of contents * wikilinks\: Wiki style links": \
  --paragraph-type="[Paragraph structure to assume. The value of 'off' is useful for formatted documents such as Markdown or Textile. Choices are\: * auto\: Try to auto detect paragraph type * block\: Treat a blank line as a paragraph break * single\: Assume every line is a paragraph * print\:  Assume every line starting with 2+ spaces or a tab starts a paragraph * unformatted\: Most lines have hard line breaks, few/no blank lines or indents * off\: Don't modify the paragraph structure]":"Paragraph structure to assume. The value of 'off' is useful for formatted documents such as Markdown or Textile. Choices are\: * auto\: Try to auto detect paragraph type * block\: Treat a blank line as a paragraph break * single\: Assume every line is a paragraph * print\:  Assume every line starting with 2+ spaces or a tab starts a paragraph * unformatted\: Most lines have hard line breaks, few/no blank lines or indents * off\: Don't modify the paragraph structure":(auto|block|single|print|unformatted|off) \
  --preserve-spaces"[Normally extra spaces are condensed into a single space. With this option all spaces will be displayed.]" \
  --txt-in-remove-indents"[Normally extra space at the beginning of lines is retained. With this option they will be removed.]" 
}

_ebc_input_opts_md() {
  _arguments -s \
  --formatting-type="[Formatting used within the document. * auto\: Automatically decide which formatting processor to use * plain\: No formatting * heuristic\: Use heuristics to determine chapter headings, italics, etc. * textile\: Use the Textile markup language * markdown\: Use the Markdown markup language To learn more about Markdown see https\://daringfireball.net/projects/markdown/]":"Formatting used within the document. * auto\: Automatically decide which formatting processor to use * plain\: No formatting * heuristic\: Use heuristics to determine chapter headings, italics, etc. * textile\: Use the Textile markup language * markdown\: Use the Markdown markup language To learn more about Markdown see https\://daringfireball.net/projects/markdown/":(auto|plain|heuristic|textile|markdown) \
  --markdown-extensions="[Enable extensions to Markdown syntax. Extensions are formatting that is not part of the standard Markdown format. The extensions enabled by default\: footnotes, tables, toc. To learn more about Markdown extensions, see https\://python-markdown.github.io/extensions/ This should be a comma separated list of extensions to enable\: * abbr\: Abbreviations * admonition\: Support admonitions * attr_list\: Add attribute to HTML tags * codehilite\: Add code highlighting via Pygments * def_list\: Definition lists * extra\: Enables various common extensions * fenced_code\: Alternative code block syntax * footnotes\: Footnotes * legacy_attrs\: Use legacy element attributes * legacy_em\: Use legacy underscore handling for connected words * meta\: Metadata in the document * nl2br\: Treat newlines as hard breaks * sane_lists\: Do not allow mixing list types * smarty\: Use Markdown's internal smartypants parser * tables\: Support tables * toc\: Generate a table of contents * wikilinks\: Wiki style links]":"Enable extensions to Markdown syntax. Extensions are formatting that is not part of the standard Markdown format. The extensions enabled by default\: footnotes, tables, toc. To learn more about Markdown extensions, see https\://python-markdown.github.io/extensions/ This should be a comma separated list of extensions to enable\: * abbr\: Abbreviations * admonition\: Support admonitions * attr_list\: Add attribute to HTML tags * codehilite\: Add code highlighting via Pygments * def_list\: Definition lists * extra\: Enables various common extensions * fenced_code\: Alternative code block syntax * footnotes\: Footnotes * legacy_attrs\: Use legacy element attributes * legacy_em\: Use legacy underscore handling for connected words * meta\: Metadata in the document * nl2br\: Treat newlines as hard breaks * sane_lists\: Do not allow mixing list types * smarty\: Use Markdown's internal smartypants parser * tables\: Support tables * toc\: Generate a table of contents * wikilinks\: Wiki style links": \
  --paragraph-type="[Paragraph structure to assume. The value of 'off' is useful for formatted documents such as Markdown or Textile. Choices are\: * auto\: Try to auto detect paragraph type * block\: Treat a blank line as a paragraph break * single\: Assume every line is a paragraph * print\:  Assume every line starting with 2+ spaces or a tab starts a paragraph * unformatted\: Most lines have hard line breaks, few/no blank lines or indents * off\: Don't modify the paragraph structure]":"Paragraph structure to assume. The value of 'off' is useful for formatted documents such as Markdown or Textile. Choices are\: * auto\: Try to auto detect paragraph type * block\: Treat a blank line as a paragraph break * single\: Assume every line is a paragraph * print\:  Assume every line starting with 2+ spaces or a tab starts a paragraph * unformatted\: Most lines have hard line breaks, few/no blank lines or indents * off\: Don't modify the paragraph structure":(auto|block|single|print|unformatted|off) \
  --preserve-spaces"[Normally extra spaces are condensed into a single space. With this option all spaces will be displayed.]" \
  --txt-in-remove-indents"[Normally extra space at the beginning of lines is retained. With this option they will be removed.]" 
}

_ebc_input_opts_opf() {
  _arguments -s \
  --allow-local-files-outside-root"[Normally, resources linked to by the HTML file or its children will only be allowed if they are in a sub-folder of the original HTML file. This option allows including local files from any location on your computer. This can be a security risk if you are converting untrusted HTML and expecting to distribute the result of the conversion.]" \
  --breadth-first"[Traverse links in HTML files breadth first. Normally, they are traversed depth first.]" \
  --dont-package"[Normally this input plugin re-arranges all the input files into a standard folder hierarchy. Only use this option if you know what you are doing as it can result in various nasty side effects in the rest of the conversion pipeline.]" \
  --max-levels="[Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.]":"Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.": 
}

_ebc_input_opts_pdf() {
  _arguments -s \
  --no-images"[Do not extract images from the document]" \
  --pdf-engine="[The PDF engine to use, the 'calibre' engine is recommended as it has automatic header and footer removal. Choices\: calibre, pdftohtml]":"The PDF engine to use, the 'calibre' engine is recommended as it has automatic header and footer removal. Choices\: calibre, pdftohtml":(calibre|pdftohtml) \
  --pdf-footer-regex="[Regular expression to remove lines at the bottom of a page. This only looks at the last line of a page and works only with the calibre PDF engine.]":"Regular expression to remove lines at the bottom of a page. This only looks at the last line of a page and works only with the calibre PDF engine.": \
  --pdf-footer-skip="[Skip everything to the specified number of pixels at the bottom of a page. Negative numbers mean auto-detect and remove footers, zero means do not remove footers and positive numbers mean remove footers that appear below that many pixels from the bottom of the page. Works only with the calibre PDF engine.]":"Skip everything to the specified number of pixels at the bottom of a page. Negative numbers mean auto-detect and remove footers, zero means do not remove footers and positive numbers mean remove footers that appear below that many pixels from the bottom of the page. Works only with the calibre PDF engine.": \
  --pdf-header-regex="[Regular expression to remove lines at the top of a page. This only looks at the first line of a page and works only with the calibre PDF engine.]":"Regular expression to remove lines at the top of a page. This only looks at the first line of a page and works only with the calibre PDF engine.": \
  --pdf-header-skip="[Skip everything to the specified number of pixels at the top of a page. Negative numbers mean auto-detect and remove headers, zero means do not remove headers and positive numbers mean remove headers that appear above that many pixels from the top of the page. Works only with the new PDF engine.]":"Skip everything to the specified number of pixels at the top of a page. Negative numbers mean auto-detect and remove headers, zero means do not remove headers and positive numbers mean remove headers that appear above that many pixels from the top of the page. Works only with the new PDF engine.": \
  --unwrap-factor="[Scale used to determine the length at which a line should be unwrapped. Valid values are a decimal between 0 and 1. The default is 0.45, just below the median line length.]":"Scale used to determine the length at which a line should be unwrapped. Valid values are a decimal between 0 and 1. The default is 0.45, just below the median line length.": 
}

_ebc_input_opts_recipe() {
  _arguments -s \
  --dont-download-recipe"[Do not download latest version of builtin recipes from the calibre server]" \
  --lrf"[Optimize fetching for subsequent conversion to LRF.]" \
  --password="[Password for sites that require a login to access content.]":"Password for sites that require a login to access content.": \
  --recipe-specific-option="[Recipe specific options. Syntax is option_name\:value. For example\: --recipe-specific-option=date\:2030-11-31. Can be specified multiple times to set different options. To see a list of all available options for a recipe, use --recipe-specific-option=list.]":"Recipe specific options. Syntax is option_name\:value. For example\: --recipe-specific-option=date\:2030-11-31. Can be specified multiple times to set different options. To see a list of all available options for a recipe, use --recipe-specific-option=list.": \
  --test"[]" \
  --username="[Username for sites that require a login to access content.]":"Username for sites that require a login to access content.": 
}

_ebc_input_opts_rtf() {
  _arguments -s \
  --ignore-wmf"[Ignore WMF images instead of replacing them with a placeholder image.]" 
}

_ebc_input_opts_shtm() {
  _arguments -s \
  --allow-local-files-outside-root"[Normally, resources linked to by the HTML file or its children will only be allowed if they are in a sub-folder of the original HTML file. This option allows including local files from any location on your computer. This can be a security risk if you are converting untrusted HTML and expecting to distribute the result of the conversion.]" \
  --breadth-first"[Traverse links in HTML files breadth first. Normally, they are traversed depth first.]" \
  --dont-package"[Normally this input plugin re-arranges all the input files into a standard folder hierarchy. Only use this option if you know what you are doing as it can result in various nasty side effects in the rest of the conversion pipeline.]" \
  --max-levels="[Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.]":"Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.": 
}

_ebc_input_opts_shtml() {
  _arguments -s \
  --allow-local-files-outside-root"[Normally, resources linked to by the HTML file or its children will only be allowed if they are in a sub-folder of the original HTML file. This option allows including local files from any location on your computer. This can be a security risk if you are converting untrusted HTML and expecting to distribute the result of the conversion.]" \
  --breadth-first"[Traverse links in HTML files breadth first. Normally, they are traversed depth first.]" \
  --dont-package"[Normally this input plugin re-arranges all the input files into a standard folder hierarchy. Only use this option if you know what you are doing as it can result in various nasty side effects in the rest of the conversion pipeline.]" \
  --max-levels="[Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.]":"Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.": 
}

_ebc_input_opts_text() {
  _arguments -s \
  --formatting-type="[Formatting used within the document. * auto\: Automatically decide which formatting processor to use * plain\: No formatting * heuristic\: Use heuristics to determine chapter headings, italics, etc. * textile\: Use the Textile markup language * markdown\: Use the Markdown markup language To learn more about Markdown see https\://daringfireball.net/projects/markdown/]":"Formatting used within the document. * auto\: Automatically decide which formatting processor to use * plain\: No formatting * heuristic\: Use heuristics to determine chapter headings, italics, etc. * textile\: Use the Textile markup language * markdown\: Use the Markdown markup language To learn more about Markdown see https\://daringfireball.net/projects/markdown/":(auto|plain|heuristic|textile|markdown) \
  --markdown-extensions="[Enable extensions to Markdown syntax. Extensions are formatting that is not part of the standard Markdown format. The extensions enabled by default\: footnotes, tables, toc. To learn more about Markdown extensions, see https\://python-markdown.github.io/extensions/ This should be a comma separated list of extensions to enable\: * abbr\: Abbreviations * admonition\: Support admonitions * attr_list\: Add attribute to HTML tags * codehilite\: Add code highlighting via Pygments * def_list\: Definition lists * extra\: Enables various common extensions * fenced_code\: Alternative code block syntax * footnotes\: Footnotes * legacy_attrs\: Use legacy element attributes * legacy_em\: Use legacy underscore handling for connected words * meta\: Metadata in the document * nl2br\: Treat newlines as hard breaks * sane_lists\: Do not allow mixing list types * smarty\: Use Markdown's internal smartypants parser * tables\: Support tables * toc\: Generate a table of contents * wikilinks\: Wiki style links]":"Enable extensions to Markdown syntax. Extensions are formatting that is not part of the standard Markdown format. The extensions enabled by default\: footnotes, tables, toc. To learn more about Markdown extensions, see https\://python-markdown.github.io/extensions/ This should be a comma separated list of extensions to enable\: * abbr\: Abbreviations * admonition\: Support admonitions * attr_list\: Add attribute to HTML tags * codehilite\: Add code highlighting via Pygments * def_list\: Definition lists * extra\: Enables various common extensions * fenced_code\: Alternative code block syntax * footnotes\: Footnotes * legacy_attrs\: Use legacy element attributes * legacy_em\: Use legacy underscore handling for connected words * meta\: Metadata in the document * nl2br\: Treat newlines as hard breaks * sane_lists\: Do not allow mixing list types * smarty\: Use Markdown's internal smartypants parser * tables\: Support tables * toc\: Generate a table of contents * wikilinks\: Wiki style links": \
  --paragraph-type="[Paragraph structure to assume. The value of 'off' is useful for formatted documents such as Markdown or Textile. Choices are\: * auto\: Try to auto detect paragraph type * block\: Treat a blank line as a paragraph break * single\: Assume every line is a paragraph * print\:  Assume every line starting with 2+ spaces or a tab starts a paragraph * unformatted\: Most lines have hard line breaks, few/no blank lines or indents * off\: Don't modify the paragraph structure]":"Paragraph structure to assume. The value of 'off' is useful for formatted documents such as Markdown or Textile. Choices are\: * auto\: Try to auto detect paragraph type * block\: Treat a blank line as a paragraph break * single\: Assume every line is a paragraph * print\:  Assume every line starting with 2+ spaces or a tab starts a paragraph * unformatted\: Most lines have hard line breaks, few/no blank lines or indents * off\: Don't modify the paragraph structure":(auto|block|single|print|unformatted|off) \
  --preserve-spaces"[Normally extra spaces are condensed into a single space. With this option all spaces will be displayed.]" \
  --txt-in-remove-indents"[Normally extra space at the beginning of lines is retained. With this option they will be removed.]" 
}

_ebc_input_opts_textile() {
  _arguments -s \
  --formatting-type="[Formatting used within the document. * auto\: Automatically decide which formatting processor to use * plain\: No formatting * heuristic\: Use heuristics to determine chapter headings, italics, etc. * textile\: Use the Textile markup language * markdown\: Use the Markdown markup language To learn more about Markdown see https\://daringfireball.net/projects/markdown/]":"Formatting used within the document. * auto\: Automatically decide which formatting processor to use * plain\: No formatting * heuristic\: Use heuristics to determine chapter headings, italics, etc. * textile\: Use the Textile markup language * markdown\: Use the Markdown markup language To learn more about Markdown see https\://daringfireball.net/projects/markdown/":(auto|plain|heuristic|textile|markdown) \
  --markdown-extensions="[Enable extensions to Markdown syntax. Extensions are formatting that is not part of the standard Markdown format. The extensions enabled by default\: footnotes, tables, toc. To learn more about Markdown extensions, see https\://python-markdown.github.io/extensions/ This should be a comma separated list of extensions to enable\: * abbr\: Abbreviations * admonition\: Support admonitions * attr_list\: Add attribute to HTML tags * codehilite\: Add code highlighting via Pygments * def_list\: Definition lists * extra\: Enables various common extensions * fenced_code\: Alternative code block syntax * footnotes\: Footnotes * legacy_attrs\: Use legacy element attributes * legacy_em\: Use legacy underscore handling for connected words * meta\: Metadata in the document * nl2br\: Treat newlines as hard breaks * sane_lists\: Do not allow mixing list types * smarty\: Use Markdown's internal smartypants parser * tables\: Support tables * toc\: Generate a table of contents * wikilinks\: Wiki style links]":"Enable extensions to Markdown syntax. Extensions are formatting that is not part of the standard Markdown format. The extensions enabled by default\: footnotes, tables, toc. To learn more about Markdown extensions, see https\://python-markdown.github.io/extensions/ This should be a comma separated list of extensions to enable\: * abbr\: Abbreviations * admonition\: Support admonitions * attr_list\: Add attribute to HTML tags * codehilite\: Add code highlighting via Pygments * def_list\: Definition lists * extra\: Enables various common extensions * fenced_code\: Alternative code block syntax * footnotes\: Footnotes * legacy_attrs\: Use legacy element attributes * legacy_em\: Use legacy underscore handling for connected words * meta\: Metadata in the document * nl2br\: Treat newlines as hard breaks * sane_lists\: Do not allow mixing list types * smarty\: Use Markdown's internal smartypants parser * tables\: Support tables * toc\: Generate a table of contents * wikilinks\: Wiki style links": \
  --paragraph-type="[Paragraph structure to assume. The value of 'off' is useful for formatted documents such as Markdown or Textile. Choices are\: * auto\: Try to auto detect paragraph type * block\: Treat a blank line as a paragraph break * single\: Assume every line is a paragraph * print\:  Assume every line starting with 2+ spaces or a tab starts a paragraph * unformatted\: Most lines have hard line breaks, few/no blank lines or indents * off\: Don't modify the paragraph structure]":"Paragraph structure to assume. The value of 'off' is useful for formatted documents such as Markdown or Textile. Choices are\: * auto\: Try to auto detect paragraph type * block\: Treat a blank line as a paragraph break * single\: Assume every line is a paragraph * print\:  Assume every line starting with 2+ spaces or a tab starts a paragraph * unformatted\: Most lines have hard line breaks, few/no blank lines or indents * off\: Don't modify the paragraph structure":(auto|block|single|print|unformatted|off) \
  --preserve-spaces"[Normally extra spaces are condensed into a single space. With this option all spaces will be displayed.]" \
  --txt-in-remove-indents"[Normally extra space at the beginning of lines is retained. With this option they will be removed.]" 
}

_ebc_input_opts_txt() {
  _arguments -s \
  --formatting-type="[Formatting used within the document. * auto\: Automatically decide which formatting processor to use * plain\: No formatting * heuristic\: Use heuristics to determine chapter headings, italics, etc. * textile\: Use the Textile markup language * markdown\: Use the Markdown markup language To learn more about Markdown see https\://daringfireball.net/projects/markdown/]":"Formatting used within the document. * auto\: Automatically decide which formatting processor to use * plain\: No formatting * heuristic\: Use heuristics to determine chapter headings, italics, etc. * textile\: Use the Textile markup language * markdown\: Use the Markdown markup language To learn more about Markdown see https\://daringfireball.net/projects/markdown/":(auto|plain|heuristic|textile|markdown) \
  --markdown-extensions="[Enable extensions to Markdown syntax. Extensions are formatting that is not part of the standard Markdown format. The extensions enabled by default\: footnotes, tables, toc. To learn more about Markdown extensions, see https\://python-markdown.github.io/extensions/ This should be a comma separated list of extensions to enable\: * abbr\: Abbreviations * admonition\: Support admonitions * attr_list\: Add attribute to HTML tags * codehilite\: Add code highlighting via Pygments * def_list\: Definition lists * extra\: Enables various common extensions * fenced_code\: Alternative code block syntax * footnotes\: Footnotes * legacy_attrs\: Use legacy element attributes * legacy_em\: Use legacy underscore handling for connected words * meta\: Metadata in the document * nl2br\: Treat newlines as hard breaks * sane_lists\: Do not allow mixing list types * smarty\: Use Markdown's internal smartypants parser * tables\: Support tables * toc\: Generate a table of contents * wikilinks\: Wiki style links]":"Enable extensions to Markdown syntax. Extensions are formatting that is not part of the standard Markdown format. The extensions enabled by default\: footnotes, tables, toc. To learn more about Markdown extensions, see https\://python-markdown.github.io/extensions/ This should be a comma separated list of extensions to enable\: * abbr\: Abbreviations * admonition\: Support admonitions * attr_list\: Add attribute to HTML tags * codehilite\: Add code highlighting via Pygments * def_list\: Definition lists * extra\: Enables various common extensions * fenced_code\: Alternative code block syntax * footnotes\: Footnotes * legacy_attrs\: Use legacy element attributes * legacy_em\: Use legacy underscore handling for connected words * meta\: Metadata in the document * nl2br\: Treat newlines as hard breaks * sane_lists\: Do not allow mixing list types * smarty\: Use Markdown's internal smartypants parser * tables\: Support tables * toc\: Generate a table of contents * wikilinks\: Wiki style links": \
  --paragraph-type="[Paragraph structure to assume. The value of 'off' is useful for formatted documents such as Markdown or Textile. Choices are\: * auto\: Try to auto detect paragraph type * block\: Treat a blank line as a paragraph break * single\: Assume every line is a paragraph * print\:  Assume every line starting with 2+ spaces or a tab starts a paragraph * unformatted\: Most lines have hard line breaks, few/no blank lines or indents * off\: Don't modify the paragraph structure]":"Paragraph structure to assume. The value of 'off' is useful for formatted documents such as Markdown or Textile. Choices are\: * auto\: Try to auto detect paragraph type * block\: Treat a blank line as a paragraph break * single\: Assume every line is a paragraph * print\:  Assume every line starting with 2+ spaces or a tab starts a paragraph * unformatted\: Most lines have hard line breaks, few/no blank lines or indents * off\: Don't modify the paragraph structure":(auto|block|single|print|unformatted|off) \
  --preserve-spaces"[Normally extra spaces are condensed into a single space. With this option all spaces will be displayed.]" \
  --txt-in-remove-indents"[Normally extra space at the beginning of lines is retained. With this option they will be removed.]" 
}

_ebc_input_opts_txtz() {
  _arguments -s \
  --formatting-type="[Formatting used within the document. * auto\: Automatically decide which formatting processor to use * plain\: No formatting * heuristic\: Use heuristics to determine chapter headings, italics, etc. * textile\: Use the Textile markup language * markdown\: Use the Markdown markup language To learn more about Markdown see https\://daringfireball.net/projects/markdown/]":"Formatting used within the document. * auto\: Automatically decide which formatting processor to use * plain\: No formatting * heuristic\: Use heuristics to determine chapter headings, italics, etc. * textile\: Use the Textile markup language * markdown\: Use the Markdown markup language To learn more about Markdown see https\://daringfireball.net/projects/markdown/":(auto|plain|heuristic|textile|markdown) \
  --markdown-extensions="[Enable extensions to Markdown syntax. Extensions are formatting that is not part of the standard Markdown format. The extensions enabled by default\: footnotes, tables, toc. To learn more about Markdown extensions, see https\://python-markdown.github.io/extensions/ This should be a comma separated list of extensions to enable\: * abbr\: Abbreviations * admonition\: Support admonitions * attr_list\: Add attribute to HTML tags * codehilite\: Add code highlighting via Pygments * def_list\: Definition lists * extra\: Enables various common extensions * fenced_code\: Alternative code block syntax * footnotes\: Footnotes * legacy_attrs\: Use legacy element attributes * legacy_em\: Use legacy underscore handling for connected words * meta\: Metadata in the document * nl2br\: Treat newlines as hard breaks * sane_lists\: Do not allow mixing list types * smarty\: Use Markdown's internal smartypants parser * tables\: Support tables * toc\: Generate a table of contents * wikilinks\: Wiki style links]":"Enable extensions to Markdown syntax. Extensions are formatting that is not part of the standard Markdown format. The extensions enabled by default\: footnotes, tables, toc. To learn more about Markdown extensions, see https\://python-markdown.github.io/extensions/ This should be a comma separated list of extensions to enable\: * abbr\: Abbreviations * admonition\: Support admonitions * attr_list\: Add attribute to HTML tags * codehilite\: Add code highlighting via Pygments * def_list\: Definition lists * extra\: Enables various common extensions * fenced_code\: Alternative code block syntax * footnotes\: Footnotes * legacy_attrs\: Use legacy element attributes * legacy_em\: Use legacy underscore handling for connected words * meta\: Metadata in the document * nl2br\: Treat newlines as hard breaks * sane_lists\: Do not allow mixing list types * smarty\: Use Markdown's internal smartypants parser * tables\: Support tables * toc\: Generate a table of contents * wikilinks\: Wiki style links": \
  --paragraph-type="[Paragraph structure to assume. The value of 'off' is useful for formatted documents such as Markdown or Textile. Choices are\: * auto\: Try to auto detect paragraph type * block\: Treat a blank line as a paragraph break * single\: Assume every line is a paragraph * print\:  Assume every line starting with 2+ spaces or a tab starts a paragraph * unformatted\: Most lines have hard line breaks, few/no blank lines or indents * off\: Don't modify the paragraph structure]":"Paragraph structure to assume. The value of 'off' is useful for formatted documents such as Markdown or Textile. Choices are\: * auto\: Try to auto detect paragraph type * block\: Treat a blank line as a paragraph break * single\: Assume every line is a paragraph * print\:  Assume every line starting with 2+ spaces or a tab starts a paragraph * unformatted\: Most lines have hard line breaks, few/no blank lines or indents * off\: Don't modify the paragraph structure":(auto|block|single|print|unformatted|off) \
  --preserve-spaces"[Normally extra spaces are condensed into a single space. With this option all spaces will be displayed.]" \
  --txt-in-remove-indents"[Normally extra space at the beginning of lines is retained. With this option they will be removed.]" 
}

_ebc_input_opts_xhtm() {
  _arguments -s \
  --allow-local-files-outside-root"[Normally, resources linked to by the HTML file or its children will only be allowed if they are in a sub-folder of the original HTML file. This option allows including local files from any location on your computer. This can be a security risk if you are converting untrusted HTML and expecting to distribute the result of the conversion.]" \
  --breadth-first"[Traverse links in HTML files breadth first. Normally, they are traversed depth first.]" \
  --dont-package"[Normally this input plugin re-arranges all the input files into a standard folder hierarchy. Only use this option if you know what you are doing as it can result in various nasty side effects in the rest of the conversion pipeline.]" \
  --max-levels="[Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.]":"Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.": 
}

_ebc_input_opts_xhtml() {
  _arguments -s \
  --allow-local-files-outside-root"[Normally, resources linked to by the HTML file or its children will only be allowed if they are in a sub-folder of the original HTML file. This option allows including local files from any location on your computer. This can be a security risk if you are converting untrusted HTML and expecting to distribute the result of the conversion.]" \
  --breadth-first"[Traverse links in HTML files breadth first. Normally, they are traversed depth first.]" \
  --dont-package"[Normally this input plugin re-arranges all the input files into a standard folder hierarchy. Only use this option if you know what you are doing as it can result in various nasty side effects in the rest of the conversion pipeline.]" \
  --max-levels="[Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.]":"Maximum levels of recursion when following links in HTML files. Must be non-negative. 0 implies that no links in the root HTML file are followed. Default is 5.": 
}

_ebc_output_opts_azw3() {
  _arguments -s \
  --dont-compress"[Disable compression of the file contents.]" \
  --extract-to="[Extract the contents of the generated AZW3 file to the specified folder. The contents of the folder are first deleted, so be careful.]":"Extract the contents of the generated AZW3 file to the specified folder. The contents of the folder are first deleted, so be careful.":'_path_files -/' \
  --mobi-toc-at-start"[When adding the Table of Contents to the book, add it at the start of the book instead of the end. Not recommended.]" \
  --no-inline-toc"[Don't add Table of Contents to the book. Useful if the book has its own table of contents.]" \
  --prefer-author-sort"[When present, use author sort field as author.]" \
  --share-not-sync"[Enable sharing of book content via Facebook etc.  on the Kindle. WARNING\: Using this feature means that  the book will not auto sync its last read position  on multiple devices. Complain to Amazon.]" \
  --toc-title="[Title for any generated inline table of contents.]":"Title for any generated inline table of contents.": 
}

_ebc_output_opts_docx() {
  _arguments -s \
  --docx-custom-page-size="[Custom size of the document. Use the form width x height, for example\: '123x321' to specify the width and height (in pts). This overrides any specified page-size.]":"Custom size of the document. Use the form width x height, for example\: '123x321' to specify the width and height (in pts). This overrides any specified page-size.": \
  --docx-no-cover"[Do not insert the book cover as an image at the start of the document. If you use this option, the book cover will be discarded.]" \
  --docx-no-toc"[Do not insert the table of contents as a page at the start of the document.]" \
  --docx-page-margin-bottom="[The size of the bottom page margin, in pts. Default is 72pt. Overrides the common bottom page margin setting, unless set to zero.]":"The size of the bottom page margin, in pts. Default is 72pt. Overrides the common bottom page margin setting, unless set to zero.": \
  --docx-page-margin-left="[The size of the left page margin, in pts. Default is 72pt. Overrides the common left page margin setting.]":"The size of the left page margin, in pts. Default is 72pt. Overrides the common left page margin setting.": \
  --docx-page-margin-right="[The size of the right page margin, in pts. Default is 72pt. Overrides the common right page margin setting, unless set to zero.]":"The size of the right page margin, in pts. Default is 72pt. Overrides the common right page margin setting, unless set to zero.": \
  --docx-page-margin-top="[The size of the top page margin, in pts. Default is 72pt. Overrides the common top page margin setting, unless set to zero.]":"The size of the top page margin, in pts. Default is 72pt. Overrides the common top page margin setting, unless set to zero.": \
  --docx-page-size="[The size of the page. Default is letter. Choices are ('a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'legal', 'letter')]":"The size of the page. Default is letter. Choices are ('a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'legal', 'letter')":(a0|a1|a2|a3|a4|a5|a6|b0|b1|b2|b3|b4|b5|b6|legal|letter) \
  --extract-to="[Extract the contents of the generated DOCX file to the specified folder. The contents of the folder are first deleted, so be careful.]":"Extract the contents of the generated DOCX file to the specified folder. The contents of the folder are first deleted, so be careful.":'_path_files -/' \
  --preserve-cover-aspect-ratio"[Preserve the aspect ratio of the cover image instead of stretching it out to cover the entire page.]" 
}

_ebc_output_opts_epub() {
  _arguments -s \
  --dont-split-on-page-breaks"[Turn off splitting at page breaks. Normally, input files are automatically split at every page break into two files. This gives an output e-book that can be parsed faster and with less resources. However, splitting is slow and if your source file contains a very large number of page breaks, you should turn off splitting on page breaks.]" \
  --epub-flatten"[This option is needed only if you intend to use the EPUB with FBReaderJ. It will flatten the file system inside the EPUB, putting all files into the top level.]" \
  --epub-inline-toc"[Insert an inline Table of Contents that will appear as part of the main book content.]" \
  --epub-max-image-size="[The maximum image size (width x height). A value of none means use the screen size from the output profile. A value of profile means no maximum size is specified. For example, a value of 100x200 will cause all images to be resized so that their width is no more than 100 pixels and their height is no more than 200 pixels. Note that this only affects the size of the actual image files themselves. Any given image may be rendered at a different size depending on the styling applied to it in the document.]":"The maximum image size (width x height). A value of none means use the screen size from the output profile. A value of profile means no maximum size is specified. For example, a value of 100x200 will cause all images to be resized so that their width is no more than 100 pixels and their height is no more than 200 pixels. Note that this only affects the size of the actual image files themselves. Any given image may be rendered at a different size depending on the styling applied to it in the document.": \
  --epub-toc-at-end"[Put the inserted inline Table of Contents at the end of the book instead of the start.]" \
  --epub-version="[The version of the EPUB file to generate. EPUB 2 is the most widely compatible, only use EPUB 3 if you know you actually need it.]":"The version of the EPUB file to generate. EPUB 2 is the most widely compatible, only use EPUB 3 if you know you actually need it.":(2|3) \
  --extract-to="[Extract the contents of the generated EPUB file to the specified folder. The contents of the folder are first deleted, so be careful.]":"Extract the contents of the generated EPUB file to the specified folder. The contents of the folder are first deleted, so be careful.":'_path_files -/' \
  --flow-size="[Split all HTML files larger than this size (in KB). This is necessary as most EPUB readers cannot handle large file sizes. The default of 260KB is the size required for Adobe Digital Editions. Set to 0 to disable size based splitting.]":"Split all HTML files larger than this size (in KB). This is necessary as most EPUB readers cannot handle large file sizes. The default of 260KB is the size required for Adobe Digital Editions. Set to 0 to disable size based splitting.": \
  --no-default-epub-cover"[Normally, if the input file has no cover and you don't specify one, a default cover is generated with the title, authors, etc. This option disables the generation of this cover.]" \
  --no-svg-cover"[Do not use SVG for the book cover. Use this option if your EPUB is going to be used on a device that does not support SVG, like the iPhone or the JetBook Lite. Without this option, such devices will display the cover as a blank page.]" \
  --preserve-cover-aspect-ratio"[When using an SVG cover, this option will cause the cover to scale to cover the available screen area, but still preserve its aspect ratio (ratio of width to height). That means there may be white borders at the sides or top and bottom of the image, but the image will never be distorted. Without this option the image may be slightly distorted, but there will be no borders.]" \
  --toc-title="[Title for any generated inline table of contents.]":"Title for any generated inline table of contents.": 
}

_ebc_output_opts_fb2() {
  _arguments -s \
  --fb2-genre="[Genre for the book. Choices\: sf_history, sf_action, sf_epic, sf_heroic, sf_detective, sf_cyberpunk, sf_space, sf_social, sf_horror, sf_humor, sf_fantasy, sf, det_classic, det_police, det_action, det_irony, det_history, det_espionage, det_crime, det_political, det_maniac, det_hard, thriller, detective, prose_classic, prose_history, prose_contemporary, prose_counter, prose_rus_classic, prose_su_classics, love_contemporary, love_history, love_detective, love_short, love_erotica, adv_western, adv_history, adv_indian, adv_maritime, adv_geo, adv_animal, adventure, child_tale, child_verse, child_prose, child_sf, child_det, child_adv, child_education, children, poetry, dramaturgy, antique_ant, antique_european, antique_russian, antique_east, antique_myths, antique, sci_history, sci_psychology, sci_culture, sci_religion, sci_philosophy, sci_politics, sci_business, sci_juris, sci_linguistic, sci_medicine, sci_phys, sci_math, sci_chem, sci_biology, sci_tech, science, comp_www, comp_programming, comp_hard, comp_soft, comp_db, comp_osnet, computers, ref_encyc, ref_dict, ref_ref, ref_guide, reference, nonf_biography, nonf_publicism, nonf_criticism, design, nonfiction, religion_rel, religion_esoterics, religion_self, religion, humor_anecdote, humor_prose, humor_verse, humor, home_cooking, home_pets, home_crafts, home_entertain, home_health, home_garden, home_diy, home_sport, home_sex, home   See\: http\://www.fictionbook.org/index.php/Eng\:FictionBook_2.1_genres for a complete list with descriptions.]":"Genre for the book. Choices\: sf_history, sf_action, sf_epic, sf_heroic, sf_detective, sf_cyberpunk, sf_space, sf_social, sf_horror, sf_humor, sf_fantasy, sf, det_classic, det_police, det_action, det_irony, det_history, det_espionage, det_crime, det_political, det_maniac, det_hard, thriller, detective, prose_classic, prose_history, prose_contemporary, prose_counter, prose_rus_classic, prose_su_classics, love_contemporary, love_history, love_detective, love_short, love_erotica, adv_western, adv_history, adv_indian, adv_maritime, adv_geo, adv_animal, adventure, child_tale, child_verse, child_prose, child_sf, child_det, child_adv, child_education, children, poetry, dramaturgy, antique_ant, antique_european, antique_russian, antique_east, antique_myths, antique, sci_history, sci_psychology, sci_culture, sci_religion, sci_philosophy, sci_politics, sci_business, sci_juris, sci_linguistic, sci_medicine, sci_phys, sci_math, sci_chem, sci_biology, sci_tech, science, comp_www, comp_programming, comp_hard, comp_soft, comp_db, comp_osnet, computers, ref_encyc, ref_dict, ref_ref, ref_guide, reference, nonf_biography, nonf_publicism, nonf_criticism, design, nonfiction, religion_rel, religion_esoterics, religion_self, religion, humor_anecdote, humor_prose, humor_verse, humor, home_cooking, home_pets, home_crafts, home_entertain, home_health, home_garden, home_diy, home_sport, home_sex, home   See\: http\://www.fictionbook.org/index.php/Eng\:FictionBook_2.1_genres for a complete list with descriptions.":(sf_history|sf_action|sf_epic|sf_heroic|sf_detective|sf_cyberpunk|sf_space|sf_social|sf_horror|sf_humor|sf_fantasy|sf|det_classic|det_police|det_action|det_irony|det_history|det_espionage|det_crime|det_political|det_maniac|det_hard|thriller|detective|prose_classic|prose_history|prose_contemporary|prose_counter|prose_rus_classic|prose_su_classics|love_contemporary|love_history|love_detective|love_short|love_erotica|adv_western|adv_history|adv_indian|adv_maritime|adv_geo|adv_animal|adventure|child_tale|child_verse|child_prose|child_sf|child_det|child_adv|child_education|children|poetry|dramaturgy|antique_ant|antique_european|antique_russian|antique_east|antique_myths|antique|sci_history|sci_psychology|sci_culture|sci_religion|sci_philosophy|sci_politics|sci_business|sci_juris|sci_linguistic|sci_medicine|sci_phys|sci_math|sci_chem|sci_biology|sci_tech|science|comp_www|comp_programming|comp_hard|comp_soft|comp_db|comp_osnet|computers|ref_encyc|ref_dict|ref_ref|ref_guide|reference|nonf_biography|nonf_publicism|nonf_criticism|design|nonfiction|religion_rel|religion_esoterics|religion_self|religion|humor_anecdote|humor_prose|humor_verse|humor|home_cooking|home_pets|home_crafts|home_entertain|home_health|home_garden|home_diy|home_sport|home_sex|home) \
  --sectionize="[Specify how sections are created\:  * nothing\: A single section  * files\: Section per file  * toc\: Section per entry in the ToC If ToC based generation fails, adjust the 'Structure detection' and/or 'Table of Contents' settings (turn on 'Force use of auto-generated Table of Contents').]":"Specify how sections are created\:  * nothing\: A single section  * files\: Section per file  * toc\: Section per entry in the ToC If ToC based generation fails, adjust the 'Structure detection' and/or 'Table of Contents' settings (turn on 'Force use of auto-generated Table of Contents').":(toc|files|nothing) 
}

_ebc_output_opts_htmlz() {
  _arguments -s \
  --htmlz-class-style="[How to handle the CSS when using css-type = 'class'. Default is external. external\: Use an external CSS file inline\: Use a <style> tag in the HTML file]":"How to handle the CSS when using css-type = 'class'. Default is external. external\: Use an external CSS file inline\: Use a <style> tag in the HTML file":(external|inline) \
  --htmlz-css-type="[Specify the handling of CSS. Default is class. class\: Use CSS classes inline\: Use the style attribute tag\: Use HTML tags wherever possible]":"Specify the handling of CSS. Default is class. class\: Use CSS classes inline\: Use the style attribute tag\: Use HTML tags wherever possible":(class|inline|tag) \
  --htmlz-title-filename"[If set this option causes the file name of the HTML file inside the HTMLZ archive to be based on the book title.]" 
}

_ebc_output_opts_lrf() {
  _arguments -s \
  --enable-autorotation"[Enable auto-rotation of images that are wider than the screen width.]" \
  --header"[Add a header to all the pages with title and author.]" \
  --header-format="[Set the format of the header. %a is replaced by the author and %t by the title. Default is %t by %a]":"Set the format of the header. %a is replaced by the author and %t by the title. Default is %t by %a": \
  --header-separation="[Add extra spacing below the header. Default is 0 pt.]":"Add extra spacing below the header. Default is 0 pt.": \
  --minimum-indent="[Minimum paragraph indent (the indent of the first line of a paragraph) in pts. Default\: 0]":"Minimum paragraph indent (the indent of the first line of a paragraph) in pts. Default\: 0": \
  --mono-family="[The monospace family of fonts to embed]":"The monospace family of fonts to embed": \
  --render-tables-as-images"[This option has no effect]" \
  --sans-family="[The sans-serif family of fonts to embed]":"The sans-serif family of fonts to embed": \
  --serif-family="[The serif family of fonts to embed]":"The serif family of fonts to embed": \
  --text-size-multiplier-for-rendered-tables="[Multiply the size of text in rendered tables by this factor. Default is 1.0]":"Multiply the size of text in rendered tables by this factor. Default is 1.0": \
  --wordspace="[Set the space between words in pts. Default is 2.5]":"Set the space between words in pts. Default is 2.5": 
}

_ebc_output_opts_mobi() {
  _arguments -s \
  --dont-compress"[Disable compression of the file contents.]" \
  --extract-to="[Extract the contents of the generated MOBI file to the specified folder. The contents of the folder are first deleted, so be careful.]":"Extract the contents of the generated MOBI file to the specified folder. The contents of the folder are first deleted, so be careful.":'_path_files -/' \
  --mobi-file-type="[By default calibre generates MOBI files that contain the old MOBI 6 format. This format is compatible with all devices. However, by changing this setting, you can tell calibre to generate MOBI files that contain both MOBI 6 and the new KF8 format, or only the new KF8 format. KF8 has more features than MOBI 6, but only works with newer Kindles. Allowed values\: old, both, new]":"By default calibre generates MOBI files that contain the old MOBI 6 format. This format is compatible with all devices. However, by changing this setting, you can tell calibre to generate MOBI files that contain both MOBI 6 and the new KF8 format, or only the new KF8 format. KF8 has more features than MOBI 6, but only works with newer Kindles. Allowed values\: old, both, new":(old|both|new) \
  --mobi-ignore-margins"[Ignore margins in the input document. If False, then the MOBI output plugin will try to convert margins specified in the input document, otherwise it will ignore them.]" \
  --mobi-keep-original-images"[By default calibre converts all images to JPEG format in the output MOBI file. This is for maximum compatibility as some older MOBI viewers have problems with other image formats. This option tells calibre not to do this. Useful if your document contains lots of GIF/PNG images that become very large when converted to JPEG.]" \
  --mobi-toc-at-start"[When adding the Table of Contents to the book, add it at the start of the book instead of the end. Not recommended.]" \
  --no-inline-toc"[Don't add Table of Contents to the book. Useful if the book has its own table of contents.]" \
  --personal-doc="[Tag for MOBI files to be marked as personal documents. This option has no effect on the conversion. It is used only when sending MOBI files to a device. If the file being sent has the specified tag, it will be marked as a personal document when sent to the Kindle.]":"Tag for MOBI files to be marked as personal documents. This option has no effect on the conversion. It is used only when sending MOBI files to a device. If the file being sent has the specified tag, it will be marked as a personal document when sent to the Kindle.": \
  --prefer-author-sort"[When present, use author sort field as author.]" \
  --share-not-sync"[Enable sharing of book content via Facebook etc.  on the Kindle. WARNING\: Using this feature means that  the book will not auto sync its last read position  on multiple devices. Complain to Amazon.]" \
  --toc-title="[Title for any generated inline table of contents.]":"Title for any generated inline table of contents.": 
}

_ebc_output_opts_pdb() {
  _arguments -s \
  --inline-toc"[Add Table of Contents to beginning of the book.]" \
  --pdb-output-encoding="[Specify the character encoding of the output document. The default is cp1252. Note\: This option is not honored by all formats.]":"Specify the character encoding of the output document. The default is cp1252. Note\: This option is not honored by all formats.": \
  {--format=,-f+}"[Format to use inside the PDB container. Choices are\: doc, ereader, ztxt]":"Format to use inside the PDB container. Choices are\: doc, ereader, ztxt":(doc|ereader|ztxt) 
}

_ebc_output_opts_pdf() {
  _arguments -s \
  --custom-size="[Custom size of the document. Use the form width x height e.g. '123x321' to specify the width and height. This overrides any specified paper-size.]":"Custom size of the document. Use the form width x height e.g. '123x321' to specify the width and height. This overrides any specified paper-size.": \
  --paper-size="[The size of the paper. This size will be overridden when a non default output profile is used. Default is letter. Choices are a0, a1, a2, a3, a4, a5, a6, b0, b1, b2, b3, b4, b5, b6, legal, letter]":"The size of the paper. This size will be overridden when a non default output profile is used. Default is letter. Choices are a0, a1, a2, a3, a4, a5, a6, b0, b1, b2, b3, b4, b5, b6, legal, letter":(a0|a1|a2|a3|a4|a5|a6|b0|b1|b2|b3|b4|b5|b6|legal|letter) \
  --pdf-add-toc"[Add a Table of Contents at the end of the PDF that lists page numbers. Useful if you want to print out the PDF. If this PDF is intended for electronic use, use the PDF Outline instead.]" \
  --pdf-default-font-size="[The default font size (in pixels)]":"The default font size (in pixels)": \
  --pdf-footer-template="[An HTML template used to generate footers on every page. The strings _PAGENUM_, _TITLE_, _AUTHOR_ and _SECTION_ will be replaced by their current values.]":"An HTML template used to generate footers on every page. The strings _PAGENUM_, _TITLE_, _AUTHOR_ and _SECTION_ will be replaced by their current values.": \
  --pdf-header-template="[An HTML template used to generate headers on every page. The strings _PAGENUM_, _TITLE_, _AUTHOR_ and _SECTION_ will be replaced by their current values.]":"An HTML template used to generate headers on every page. The strings _PAGENUM_, _TITLE_, _AUTHOR_ and _SECTION_ will be replaced by their current values.": \
  --pdf-hyphenate"[Break long words at the end of lines. This can give the text at the right margin a more even appearance. Note that depending on the fonts used this option can break the copying of text from the PDF file.]" \
  --pdf-mark-links"[Surround all links with a red box, useful for debugging.]" \
  --pdf-mono-family="[The font family used to render monospace fonts. Will work only if the font is available system-wide.]":"The font family used to render monospace fonts. Will work only if the font is available system-wide.": \
  --pdf-mono-font-size="[The default font size for monospaced text (in pixels)]":"The default font size for monospaced text (in pixels)": \
  --pdf-no-cover"[Do not insert the book cover as an image at the start of the document. If you use this option, the book cover will be discarded.]" \
  --pdf-odd-even-offset="[Shift the text horizontally by the specified offset (in pts). On odd numbered pages, it is shifted to the right and on even numbered pages to the left. Use negative numbers for the opposite effect. Note that this setting is ignored on pages where the margins are smaller than the specified offset. Shifting is done by setting the PDF CropBox, not all software respects the CropBox.]":"Shift the text horizontally by the specified offset (in pts). On odd numbered pages, it is shifted to the right and on even numbered pages to the left. Use negative numbers for the opposite effect. Note that this setting is ignored on pages where the margins are smaller than the specified offset. Shifting is done by setting the PDF CropBox, not all software respects the CropBox.": \
  --pdf-page-margin-bottom="[The size of the bottom page margin, in pts. Default is 72pt. Overrides the common bottom page margin setting, unless set to zero.]":"The size of the bottom page margin, in pts. Default is 72pt. Overrides the common bottom page margin setting, unless set to zero.": \
  --pdf-page-margin-left="[The size of the left page margin, in pts. Default is 72pt. Overrides the common left page margin setting.]":"The size of the left page margin, in pts. Default is 72pt. Overrides the common left page margin setting.": \
  --pdf-page-margin-right="[The size of the right page margin, in pts. Default is 72pt. Overrides the common right page margin setting, unless set to zero.]":"The size of the right page margin, in pts. Default is 72pt. Overrides the common right page margin setting, unless set to zero.": \
  --pdf-page-margin-top="[The size of the top page margin, in pts. Default is 72pt. Overrides the common top page margin setting, unless set to zero.]":"The size of the top page margin, in pts. Default is 72pt. Overrides the common top page margin setting, unless set to zero.": \
  --pdf-page-number-map="[Adjust page numbers, as needed. Syntax is a JavaScript expression for the page number. For example, 'if (n < 3) 0; else n - 3;', where n is current page number.]":"Adjust page numbers, as needed. Syntax is a JavaScript expression for the page number. For example, 'if (n < 3) 0; else n - 3;', where n is current page number.": \
  --pdf-page-numbers"[Add page numbers to the bottom of every page in the generated PDF file. If you specify a footer template, it will take precedence over this option.]" \
  --pdf-sans-family="[The font family used to render sans-serif fonts. Will work only if the font is available system-wide.]":"The font family used to render sans-serif fonts. Will work only if the font is available system-wide.": \
  --pdf-serif-family="[The font family used to render serif fonts. Will work only if the font is available system-wide.]":"The font family used to render serif fonts. Will work only if the font is available system-wide.": \
  --pdf-standard-font="[The type of font family used to render font for which no font family is specified.]":"The type of font family used to render font for which no font family is specified.":(serif|sans|mono) \
  --pdf-use-document-margins"[Use the page margins specified in the input document via @page CSS rules. This will cause the margins specified in the conversion settings to be ignored. If the document does not specify page margins, the conversion settings will be used as a fallback.]" \
  --preserve-cover-aspect-ratio"[Preserve the aspect ratio of the cover, instead of stretching it to fill the full first page of the generated PDF.]" \
  --toc-title="[Title for generated table of contents.]":"Title for generated table of contents.": \
  --uncompressed-pdf"[Generate an uncompressed PDF, useful for debugging.]" \
  --use-profile-size"[Instead of using the paper size specified in the PDF Output options, use a paper size corresponding to the current output profile. Useful if you want to generate a PDF for viewing on a specific device.]" \
  {--unit=,-u+}"[The unit of measure for page sizes. Default is inch. Choices are millimeter, centimeter, point, inch, pica, didot, cicero, devicepixel Note\: This does not override the unit for margins!]":"The unit of measure for page sizes. Default is inch. Choices are millimeter, centimeter, point, inch, pica, didot, cicero, devicepixel Note\: This does not override the unit for margins!":(millimeter|centimeter|point|inch|pica|didot|cicero|devicepixel) 
}

_ebc_output_opts_pmlz() {
  _arguments -s \
  --full-image-depth"[Do not reduce the size or bit depth of images. Images have their size and depth reduced by default to accommodate applications that can not convert images on their own such as Dropbook.]" \
  --inline-toc"[Add Table of Contents to beginning of the book.]" \
  --pml-output-encoding="[Specify the character encoding of the output document. The default is cp1252.]":"Specify the character encoding of the output document. The default is cp1252.": 
}

_ebc_output_opts_rb() {
  _arguments -s \
  --inline-toc"[Add Table of Contents to beginning of the book.]" 
}

_ebc_output_opts_snb() {
  _arguments -s \
  --snb-dont-indent-first-line"[Specify whether or not to insert two space characters to indent the first line of each paragraph.]" \
  --snb-full-screen"[Resize all the images for full screen mode. ]" \
  --snb-hide-chapter-name"[Specify whether or not to hide the chapter title for each chapter. Useful for image-only output (eg. comics).]" \
  --snb-insert-empty-line"[Specify whether or not to insert an empty line between two paragraphs.]" \
  --snb-max-line-length="[The maximum number of characters per line. This splits on the first space before the specified value. If no space is found the line will be broken at the space after and will exceed the specified value. Also, there is a minimum of 25 characters. Use 0 to disable line splitting.]":"The maximum number of characters per line. This splits on the first space before the specified value. If no space is found the line will be broken at the space after and will exceed the specified value. Also, there is a minimum of 25 characters. Use 0 to disable line splitting.": \
  --snb-output-encoding="[Specify the character encoding of the output document. The default is utf-8.]":"Specify the character encoding of the output document. The default is utf-8.": 
}

_ebc_output_opts_tcr() {
  _arguments -s \
  --tcr-output-encoding="[Specify the character encoding of the output document. The default is utf-8.]":"Specify the character encoding of the output document. The default is utf-8.": 
}

_ebc_output_opts_txt() {
  _arguments -s \
  --force-max-line-length"[Force splitting on the max-line-length value when no space is present. Also allows max-line-length to be below the minimum]" \
  --inline-toc"[Add Table of Contents to beginning of the book.]" \
  --keep-color"[Do not remove font color from output. This is only useful when TXT output formatting is set to textile. Textile is the only formatting that supports setting font color. If this option is not specified font color will not be set and default to the color displayed by the reader (generally this is black).]" \
  --keep-image-references"[Do not remove image references within the document. This is only useful when paired with a TXT output formatting option that is not none because links are always removed with plain text output.]" \
  --keep-links"[Do not remove links within the document. This is only useful when paired with a TXT output formatting option that is not none because links are always removed with plain text output.]" \
  --max-line-length="[The maximum number of characters per line. This splits on the first space before the specified value. If no space is found the line will be broken at the space after and will exceed the specified value. Also, there is a minimum of 25 characters. Use 0 to disable line splitting.]":"The maximum number of characters per line. This splits on the first space before the specified value. If no space is found the line will be broken at the space after and will exceed the specified value. Also, there is a minimum of 25 characters. Use 0 to disable line splitting.": \
  --txt-output-encoding="[Specify the character encoding of the output document. The default is utf-8.]":"Specify the character encoding of the output document. The default is utf-8.": \
  --txt-output-formatting="[Formatting used within the document. * plain\: Plain text * markdown\: Markdown formatted text * textile\: Textile formatted text]":"Formatting used within the document. * plain\: Plain text * markdown\: Markdown formatted text * textile\: Textile formatted text":(plain|markdown|textile) \
  {--newline=,-n+}"[Type of newline to use. Options are ('old_mac', 'system', 'unix', 'windows'). Default is 'system'. Use 'old_mac' for compatibility with Mac OS 9 and earlier. For macOS use 'unix'. 'system' will default to the newline type used by this OS.]":"Type of newline to use. Options are ('old_mac', 'system', 'unix', 'windows'). Default is 'system'. Use 'old_mac' for compatibility with Mac OS 9 and earlier. For macOS use 'unix'. 'system' will default to the newline type used by this OS.":(system|unix|old_mac|windows) 
}

_ebc_output_opts_txtz() {
  _arguments -s \
  --force-max-line-length"[Force splitting on the max-line-length value when no space is present. Also allows max-line-length to be below the minimum]" \
  --inline-toc"[Add Table of Contents to beginning of the book.]" \
  --keep-color"[Do not remove font color from output. This is only useful when TXT output formatting is set to textile. Textile is the only formatting that supports setting font color. If this option is not specified font color will not be set and default to the color displayed by the reader (generally this is black).]" \
  --keep-image-references"[Do not remove image references within the document. This is only useful when paired with a TXT output formatting option that is not none because links are always removed with plain text output.]" \
  --keep-links"[Do not remove links within the document. This is only useful when paired with a TXT output formatting option that is not none because links are always removed with plain text output.]" \
  --max-line-length="[The maximum number of characters per line. This splits on the first space before the specified value. If no space is found the line will be broken at the space after and will exceed the specified value. Also, there is a minimum of 25 characters. Use 0 to disable line splitting.]":"The maximum number of characters per line. This splits on the first space before the specified value. If no space is found the line will be broken at the space after and will exceed the specified value. Also, there is a minimum of 25 characters. Use 0 to disable line splitting.": \
  --txt-output-encoding="[Specify the character encoding of the output document. The default is utf-8.]":"Specify the character encoding of the output document. The default is utf-8.": \
  --txt-output-formatting="[Formatting used within the document. * plain\: Plain text * markdown\: Markdown formatted text * textile\: Textile formatted text]":"Formatting used within the document. * plain\: Plain text * markdown\: Markdown formatted text * textile\: Textile formatted text":(plain|markdown|textile) \
  {--newline=,-n+}"[Type of newline to use. Options are ('old_mac', 'system', 'unix', 'windows'). Default is 'system'. Use 'old_mac' for compatibility with Mac OS 9 and earlier. For macOS use 'unix'. 'system' will default to the newline type used by this OS.]":"Type of newline to use. Options are ('old_mac', 'system', 'unix', 'windows'). Default is 'system'. Use 'old_mac' for compatibility with Mac OS 9 and earlier. For macOS use 'unix'. 'system' will default to the newline type used by this OS.":(system|unix|old_mac|windows) 
}

_ebc_output_opts_zip() {
  _arguments -s \
  --extract-to="[Extract the contents of the generated ZIP file to the specified folder. WARNING\: The contents of the folder will be deleted.]":"Extract the contents of the generated ZIP file to the specified folder. WARNING\: The contents of the folder will be deleted.":'_path_files -/' \
  --template-css="[CSS file used for the output instead of the default file]":"CSS file used for the output instead of the default file": \
  --template-html-index="[Template used for generation of the HTML index file instead of the default file]":"Template used for generation of the HTML index file instead of the default file": \
  --template-html="[Template used for the generation of the HTML contents of the book instead of the default file]":"Template used for the generation of the HTML contents of the book instead of the default file": 
}

_ebook_convert() {
  local iarg oarg context state_descr state line
  typeset -A opt_args
  local ret=1
  _arguments '1: :_ebc_input_args' '*::ebook-convert output:->args' && ret=0
  case $state in 
  (args)
    iarg=${line[1]##*.}; 
    _arguments '1: :_ebc_output_args' '*::ebook-convert options:->args' && ret=0
     case $state in 
    (args)
      oarg=${line[1]##*.}
      iarg="_ebc_input_opts_${(L)iarg}"; oarg="_ebc_output_opts_${(L)oarg}"
      _call_function - $iarg; _call_function - $oarg; _ebc_common_opts; ret=0
    ;;
    esac
  ;;
  esac
  return ret
}

_calibredb_cmds() {
  local commands; commands=(
    {-h,--help}":Show help"
    "--version:Show version"
    "list:List the books available in the calibre database"
    "add:Add the specified files as books to the database"
    "remove:Remove the books identified by ids from the database"
    "add_format:Add the e-book in ebook_file to the available formats for the logical book identified by id"
    "remove_format:Remove the format fmt from the logical book identified by id"
    "show_metadata:Show the metadata stored in the calibre database for the book identified by id"
    "set_metadata:Set the metadata stored in the calibre database for the book identified by"
    "export:Export the books specified by ids (a comma separated list) to the filesystem"
    "catalog:Export a catalog in format specified by path/to/destination extension"
    "saved_searches:Manage the saved searches stored in this database"
    "add_custom_column:Create a custom column"
    "custom_columns:List available custom columns"
    "remove_custom_column:Remove the custom column identified by label"
    "set_custom:Set the value of a custom column for the book identified by id"
    "restore_database:Restore this database from the metadata stored in OPF files in each"
    "check_library:Perform some checks on the filesystem representing a library"
    "list_categories:Produce a report of the category information in the database"
    "backup_metadata:Backup the metadata stored in the database into individual OPF files in each"
    "clone:Create a clone of the current library"
    "embed_metadata:Update the metadata in the actual book files stored in the calibre library from"
    "search:Search the library for the specified search term, returning a comma separated"
    "fts_index:Control the Full text search indexing process"
    "fts_search:Do a full text search on the entire library or a subset of it"
  )
  _describe -t commands "calibredb command" commands 
}

_calibredb() {
    local state line state_descr context
    typeset -A opt_args
    local ret=1

    _arguments \
        '1: :_calibredb_cmds' \
        '*::calibredb subcommand options:->args' \
        && ret=0

    case $state in
    (args)
    case $line[1] in
      (-h|--help|--version)
          _message 'no more arguments' && ret=0
      ;;
    (list)
      _arguments -s \
        {--fields=,-f+}"[The fields to display when listing books in the database. Should be a comma separated list of fields. Available fields\: author_sort, authors, comments, cover, formats, identifiers, isbn, languages, last_modified, pubdate, publisher, rating, series, series_index, size, tags, template, timestamp, title, uuid Default\: title,authors. The special field 'all' can be used to select all fields. In addition to the builtin fields above, custom fields are also available as *field_name, for example, for a custom field #rating, use the name\: *rating]":"The fields to display when listing books in the database. Should be a comma separated list of fields. Available fields\: author_sort, authors, comments, cover, formats, identifiers, isbn, languages, last_modified, pubdate, publisher, rating, series, series_index, size, tags, template, timestamp, title, uuid Default\: title,authors. The special field 'all' can be used to select all fields. In addition to the builtin fields above, custom fields are also available as *field_name, for example, for a custom field #rating, use the name\: *rating": \
        --sort-by="[The field by which to sort the results. You can specify multiple fields by separating them with commas. Available fields\: author_sort, authors, comments, cover, formats, identifiers, isbn, languages, last_modified, pubdate, publisher, rating, series, series_index, size, tags, template, timestamp, title, uuid Default\: id]":"The field by which to sort the results. You can specify multiple fields by separating them with commas. Available fields\: author_sort, authors, comments, cover, formats, identifiers, isbn, languages, last_modified, pubdate, publisher, rating, series, series_index, size, tags, template, timestamp, title, uuid Default\: id": \
        --ascending"[Sort results in ascending order]" \
        {--search=,-s+}"[Filter the results by the search query. For the format of the search query, please see the search related documentation in the User Manual. Default is to do no filtering.]":"Filter the results by the search query. For the format of the search query, please see the search related documentation in the User Manual. Default is to do no filtering.": \
        {--line-width=,-w+}"[The maximum width of a single line in the output. Defaults to detecting screen size.]":"The maximum width of a single line in the output. Defaults to detecting screen size.": \
        --separator="[The string used to separate fields. Default is a space.]":"The string used to separate fields. Default is a space.": \
        --prefix="[The prefix for all file paths. Default is the absolute path to the library folder.]":"The prefix for all file paths. Default is the absolute path to the library folder.": \
        --limit="[The maximum number of results to display. Default\: all]":"The maximum number of results to display. Default\: all": \
        --for-machine"[Generate output in JSON format, which is more suitable for machine parsing. Causes the line width and separator options to be ignored.]" \
        --template="[The template to run if 'template' is in the field list. Note that templates are ignored while connecting to a calibre server. Default\: None]":"The template to run if 'template' is in the field list. Note that templates are ignored while connecting to a calibre server. Default\: None": \
        {--template_file=,-t+}"[Path to a file containing the template to run if 'template' is in the field list. Default\: None]":"Path to a file containing the template to run if 'template' is in the field list. Default\: None": \
        --template_heading="[Heading for the template column. Default\: template. This option is ignored if the option --for-machine is set]":"Heading for the template column. Default\: template. This option is ignored if the option --for-machine is set": \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (add)
      _arguments -s \
        {--duplicates,-d}"[Add books to database even if they already exist. Comparison is done based on book titles and authors. Note that the --automerge option takes precedence.]" \
        {--automerge=,-m+}"[If books with similar titles and authors are found, merge the incoming formats (files) automatically into existing book records. A value of 'ignore' means duplicate formats are discarded. A value of 'overwrite' means duplicate formats in the library are overwritten with the newly added files. A value of 'new_record' means duplicate formats are placed into a new book record.]":"If books with similar titles and authors are found, merge the incoming formats (files) automatically into existing book records. A value of 'ignore' means duplicate formats are discarded. A value of 'overwrite' means duplicate formats in the library are overwritten with the newly added files. A value of 'new_record' means duplicate formats are placed into a new book record.":(disabled|ignore|overwrite|new_record) \
        {--empty,-e}"[Add an empty book (a book with no formats)]" \
        {--title=,-t+}"[Set the title of the added book(s)]":"Set the title of the added book(s)": \
        {--authors=,-a+}"[Set the authors of the added book(s)]":"Set the authors of the added book(s)": \
        {--isbn=,-i+}"[Set the ISBN of the added book(s)]":"Set the ISBN of the added book(s)": \
        {--identifier=,-I+}"[Set the identifiers for this book, e.g. -I asin\:XXX -I isbn\:YYY]":"Set the identifiers for this book, e.g. -I asin\:XXX -I isbn\:YYY": \
        {--tags=,-T+}"[Set the tags of the added book(s)]":"Set the tags of the added book(s)": \
        {--series=,-s+}"[Set the series of the added book(s)]":"Set the series of the added book(s)": \
        {--series-index=,-S+}"[Set the series number of the added book(s)]":"Set the series number of the added book(s)": \
        {--cover=,-c+}"[Path to the cover to use for the added book]":"Path to the cover to use for the added book":'_files -g "*.BMP *.GIF *.JPEG *.JPG *.PNG *.bmp *.gif *.jpeg *.jpg *.png"' \
        {--languages=,-l+}"[A comma separated list of languages (best to use ISO639 language codes, though some language names may also be recognized)]":"A comma separated list of languages (best to use ISO639 language codes, though some language names may also be recognized)": \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": \
        {--one-book-per-directory,-1}"[Assume that each folder has only a single logical book and that all files in it are different e-book formats of that book]" \
        {--recurse,-r}"[Process folders recursively]" \
        --ignore="[A filename (glob) pattern, files matching this pattern will be ignored when scanning folders for files. Can be specified multiple times for multiple patterns. For example\: *.pdf will ignore all PDF files]":"A filename (glob) pattern, files matching this pattern will be ignored when scanning folders for files. Can be specified multiple times for multiple patterns. For example\: *.pdf will ignore all PDF files": \
        --add="[A filename (glob) pattern, files matching this pattern will be added when scanning folders for files, even if they are not of a known e-book file type. Can be specified multiple times for multiple patterns.]":"A filename (glob) pattern, files matching this pattern will be added when scanning folders for files, even if they are not of a known e-book file type. Can be specified multiple times for multiple patterns.": \
        '*:filename:_files' 
    ;;
    (remove)
      _arguments -s \
        --permanent"[Do not use the Recycle Bin]" \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (add_format)
      _arguments -s \
        --dont-replace"[Do not replace the format if it already exists]" \
        --as-extra-data-file"[Add the file as an extra data file to the book, not an ebook format]" \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": \
        '*:filename:_files' 
    ;;
    (remove_format)
      _arguments -s \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (show_metadata)
      _arguments -s \
        --as-opf"[Print metadata in OPF form (XML)]" \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (set_metadata)
      _arguments -s \
        {--field=,-f+}"[The field to set. Format is field_name\:value, for example\: --field tags\:tag1,tag2. Use --list-fields to get a list of all field names. You can specify this option multiple times to set multiple fields. Note\: For languages you must use the ISO639 language codes (e.g. en for English, fr for French and so on). For identifiers, the syntax is --field identifiers\:isbn\:XXXX,doi\:YYYYY. For boolean (yes/no) fields use true and false or yes and no.]":"The field to set. Format is field_name\:value, for example\: --field tags\:tag1,tag2. Use --list-fields to get a list of all field names. You can specify this option multiple times to set multiple fields. Note\: For languages you must use the ISO639 language codes (e.g. en for English, fr for French and so on). For identifiers, the syntax is --field identifiers\:isbn\:XXXX,doi\:YYYYY. For boolean (yes/no) fields use true and false or yes and no.": \
        {--list-fields,-l}"[List the metadata field names that can be used with the --field option]" \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": \
        '*:filename:_files -g "*.OPF *.opf"' 
    ;;
    (export)
      _arguments -s \
        --all"[Export all books in database, ignoring the list of ids.]" \
        --to-dir="[Export books to the specified folder. Default is .]":"Export books to the specified folder. Default is .":'_path_files -/' \
        --single-dir"[Export all books into a single folder]" \
        --progress"[Report progress]" \
        --dont-asciiize"[Have calibre convert all non English characters into English equivalents for the file names. This is useful if saving to a legacy filesystem without full support for Unicode filenames. Specifying this switch will turn this behavior off.]" \
        --dont-update-metadata"[Normally, calibre will update the metadata in the saved files from what is in the calibre library. Makes saving to disk slower. Specifying this switch will turn this behavior off.]" \
        --dont-write-opf"[Normally, calibre will write the metadata into a separate OPF file along with the actual e-book files. Specifying this switch will turn this behavior off.]" \
        --dont-save-cover"[Normally, calibre will save the cover in a separate file along with the actual e-book files. Specifying this switch will turn this behavior off.]" \
        --dont-save-extra-files"[Save any data files associated with the book when saving the book Specifying this switch will turn this behavior off.]" \
        --timefmt="[The format in which to display dates. %d - day, %b - month, %m - month number, %Y - year. Default is\: %b, %Y]":"The format in which to display dates. %d - day, %b - month, %m - month number, %Y - year. Default is\: %b, %Y": \
        --template="[The template to control the filename and folder structure of the saved files. Default is '{author_sort}/{title}/{title} - {authors}' which will save books into a per-author subfolder with filenames containing title and author. Available controls are\: {author_sort, authors, id, isbn, languages, last_modified, pubdate, publisher, rating, series, series_index, tags, timestamp, title}]":"The template to control the filename and folder structure of the saved files. Default is '{author_sort}/{title}/{title} - {authors}' which will save books into a per-author subfolder with filenames containing title and author. Available controls are\: {author_sort, authors, id, isbn, languages, last_modified, pubdate, publisher, rating, series, series_index, tags, timestamp, title}": \
        --formats="[Comma separated list of formats to save for each book. By default all available formats are saved.]":"Comma separated list of formats to save for each book. By default all available formats are saved.": \
        --replace-whitespace"[Replace whitespace with underscores.]" \
        --to-lowercase"[Convert paths to lowercase.]" \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (catalog)
      _arguments -s \
        {--ids=,-i+}"[Comma-separated list of database IDs to catalog. If declared, --search is ignored. Default\: all]":"Comma-separated list of database IDs to catalog. If declared, --search is ignored. Default\: all": \
        {--search=,-s+}"[Filter the results by the search query. For the format of the search query, please see the search-related documentation in the User Manual. Default\: no filtering]":"Filter the results by the search query. For the format of the search query, please see the search-related documentation in the User Manual. Default\: no filtering": \
        {--verbose,-v}"[Show detailed output information. Useful for debugging]" \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": \
        --catalog-title="[Title of generated catalog used as title in metadata. Default\: 'My Books' Applies to\: AZW3, EPUB, MOBI output formats]":"Title of generated catalog used as title in metadata. Default\: 'My Books' Applies to\: AZW3, EPUB, MOBI output formats": \
        --cross-reference-authors"[Create cross-references in Authors section for books with multiple authors. Default\: 'False' Applies to\: AZW3, EPUB, MOBI output formats]" \
        --debug-pipeline="[Save the output from different stages of the conversion pipeline to the specified folder. Useful if you are unsure at which stage of the conversion process a bug is occurring. Default\: 'None' Applies to\: AZW3, EPUB, MOBI output formats]":"Save the output from different stages of the conversion pipeline to the specified folder. Useful if you are unsure at which stage of the conversion process a bug is occurring. Default\: 'None' Applies to\: AZW3, EPUB, MOBI output formats":'_path_files -/' \
        --exclude-genre="[Regex describing tags to exclude as genres. Default\: '\[.+\]|^\+$' excludes bracketed tags, e.g. '(Project Gutenberg)', and '+', the default tag for read books. Applies to\: AZW3, EPUB, MOBI output formats]":"Regex describing tags to exclude as genres. Default\: '\[.+\]|^\+$' excludes bracketed tags, e.g. '(Project Gutenberg)', and '+', the default tag for read books. Applies to\: AZW3, EPUB, MOBI output formats": \
        --exclusion-rules="[Specifies the rules used to exclude books from the generated catalog. The model for an exclusion rule is either ('<rule name>','Tags','<comma-separated list of tags>') or ('<rule name>','<custom column>','<pattern>'). For example\: (('Archived books','#status','Archived'),) will exclude a book with a value of 'Archived' in the custom column 'status'. When multiple rules are defined, all rules will be applied. Default\:  '(('Catalogs','Tags','Catalog'),)' Applies to\: AZW3, EPUB, MOBI output formats]":"Specifies the rules used to exclude books from the generated catalog. The model for an exclusion rule is either ('<rule name>','Tags','<comma-separated list of tags>') or ('<rule name>','<custom column>','<pattern>'). For example\: (('Archived books','#status','Archived'),) will exclude a book with a value of 'Archived' in the custom column 'status'. When multiple rules are defined, all rules will be applied. Default\:  '(('Catalogs','Tags','Catalog'),)' Applies to\: AZW3, EPUB, MOBI output formats": \
        --generate-authors"[Include 'Authors' section in catalog. Default\: 'False' Applies to\: AZW3, EPUB, MOBI output formats]" \
        --generate-descriptions"[Include 'Descriptions' section in catalog. Default\: 'False' Applies to\: AZW3, EPUB, MOBI output formats]" \
        --generate-genres"[Include 'Genres' section in catalog. Default\: 'False' Applies to\: AZW3, EPUB, MOBI output formats]" \
        --generate-titles"[Include 'Titles' section in catalog. Default\: 'False' Applies to\: AZW3, EPUB, MOBI output formats]" \
        --generate-series"[Include 'Series' section in catalog. Default\: 'False' Applies to\: AZW3, EPUB, MOBI output formats]" \
        --generate-recently-added"[Include 'Recently Added' section in catalog. Default\: 'False' Applies to\: AZW3, EPUB, MOBI output formats]" \
        --genre-source-field="[Source field for 'Genres' section. Default\: 'Tags' Applies to\: AZW3, EPUB, MOBI output formats]":"Source field for 'Genres' section. Default\: 'Tags' Applies to\: AZW3, EPUB, MOBI output formats": \
        --header-note-source-field="[Custom field containing note text to insert in Description header. Default\: '' Applies to\: AZW3, EPUB, MOBI output formats]":"Custom field containing note text to insert in Description header. Default\: '' Applies to\: AZW3, EPUB, MOBI output formats": \
        --merge-comments-rule="[#<custom field>\:(before|after)\:(True|False) specifying\:  <custom field> Custom field containing notes to merge with comments  (before|after) Placement of notes with respect to comments  (True|False) - A horizontal rule is inserted between notes and comments Default\: '::' Applies to\: AZW3, EPUB, MOBI output formats]":"#<custom field>\:(before|after)\:(True|False) specifying\:  <custom field> Custom field containing notes to merge with comments  (before|after) Placement of notes with respect to comments  (True|False) - A horizontal rule is inserted between notes and comments Default\: '::' Applies to\: AZW3, EPUB, MOBI output formats": \
        --output-profile="[Specifies the output profile. In some cases, an output profile is required to optimize the catalog for the device. For example, 'kindle' or 'kindle_dx' creates a structured Table of Contents with Sections and Articles. Default\: 'None' Applies to\: AZW3, EPUB, MOBI output formats]":"Specifies the output profile. In some cases, an output profile is required to optimize the catalog for the device. For example, 'kindle' or 'kindle_dx' creates a structured Table of Contents with Sections and Articles. Default\: 'None' Applies to\: AZW3, EPUB, MOBI output formats": \
        --prefix-rules="[Specifies the rules used to include prefixes indicating read books, wishlist items and other user-specified prefixes. The model for a prefix rule is ('<rule name>','<source field>','<pattern>','<prefix>'). When multiple rules are defined, the first matching rule will be used. Default\: '(('Read books','tags','+','✓'),('Wishlist item','tags','Wishlist','×'))' Applies to\: AZW3, EPUB, MOBI output formats]":"Specifies the rules used to include prefixes indicating read books, wishlist items and other user-specified prefixes. The model for a prefix rule is ('<rule name>','<source field>','<pattern>','<prefix>'). When multiple rules are defined, the first matching rule will be used. Default\: '(('Read books','tags','+','✓'),('Wishlist item','tags','Wishlist','×'))' Applies to\: AZW3, EPUB, MOBI output formats": \
        --preset="[Use a named preset created with the GUI catalog builder. A preset specifies all settings for building a catalog. Default\: 'None' Applies to\: AZW3, EPUB, MOBI output formats]":"Use a named preset created with the GUI catalog builder. A preset specifies all settings for building a catalog. Default\: 'None' Applies to\: AZW3, EPUB, MOBI output formats": \
        --use-existing-cover"[Replace existing cover when generating the catalog. Default\: 'False' Applies to\: AZW3, EPUB, MOBI output formats]" \
        --thumb-width="[Size hint (in inches) for book covers in catalog. Range\: 1.0 - 2.0 Default\: '1.0' Applies to\: AZW3, EPUB, MOBI output formats]":"Size hint (in inches) for book covers in catalog. Range\: 1.0 - 2.0 Default\: '1.0' Applies to\: AZW3, EPUB, MOBI output formats": \
        '*:filename:_files -g "*.AZW3 *.BIB *.CSV *.EPUB *.MOBI *.XML *.azw3 *.bib *.csv *.epub *.mobi *.xml"' 
    ;;
    (saved_searches)
      _arguments -s \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (add_custom_column)
      _arguments -s \
        --is-multiple"[This column stores tag like data (i.e. multiple comma separated values). Only applies if datatype is text.]" \
        --display="[A dictionary of options to customize how the data in this column will be interpreted. This is a JSON  string. For enumeration columns, use --display='{\'enum_values\'\:(\'val1\', \'val2\')}' There are many options that can go into the display variable.The options by column type are\: composite\: composite_template, composite_sort, make_category,contains_html, use_decorations datetime\: date_format enumeration\: enum_values, enum_colors, use_decorations int, float\: number_format text\: is_names, use_decorations  The best way to find legal combinations is to create a custom column of the appropriate type in the GUI then look at the backup OPF for a book (ensure that a new OPF has been created since the column was added). You will see the JSON for the 'display' for the new column in the OPF.]":"A dictionary of options to customize how the data in this column will be interpreted. This is a JSON  string. For enumeration columns, use --display='{\'enum_values\'\:(\'val1\', \'val2\')}' There are many options that can go into the display variable.The options by column type are\: composite\: composite_template, composite_sort, make_category,contains_html, use_decorations datetime\: date_format enumeration\: enum_values, enum_colors, use_decorations int, float\: number_format text\: is_names, use_decorations  The best way to find legal combinations is to create a custom column of the appropriate type in the GUI then look at the backup OPF for a book (ensure that a new OPF has been created since the column was added). You will see the JSON for the 'display' for the new column in the OPF.": \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (custom_columns)
      _arguments -s \
        {--details,-d}"[Show details for each column.]" \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (remove_custom_column)
      _arguments -s \
        {--force,-f}"[Do not ask for confirmation]" \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (set_custom)
      _arguments -s \
        {--append,-a}"[If the column stores multiple values, append the specified values to the existing ones, instead of replacing them.]" \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (restore_database)
      _arguments -s \
        {--really-do-it,-r}"[Really do the recovery. The command will not run unless this option is specified.]" \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (check_library)
      _arguments -s \
        {--csv,-c}"[Output in CSV]" \
        {--report=,-r+}"[Comma-separated list of reports. Default\: all]":"Comma-separated list of reports. Default\: all": \
        {--ignore_extensions=,-e+}"[Comma-separated list of extensions to ignore. Default\: all]":"Comma-separated list of extensions to ignore. Default\: all": \
        {--ignore_names=,-n+}"[Comma-separated list of names to ignore. Default\: all]":"Comma-separated list of names to ignore. Default\: all": \
        --vacuum-fts-db"[Vacuum the full text search database. This can be very slow and memory intensive, depending on the size of the database.]" \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (list_categories)
      _arguments -s \
        {--item_count,-i}"[Output only the number of items in a category instead of the counts per item within the category]" \
        {--csv,-c}"[Output in CSV]" \
        --dialect="[The type of CSV file to produce. Choices\: excel, excel-tab, unix]":"The type of CSV file to produce. Choices\: excel, excel-tab, unix":(excel|excel-tab|unix) \
        {--categories=,-r+}"[Comma-separated list of category lookup names. Default\: all]":"Comma-separated list of category lookup names. Default\: all": \
        {--width=,-w+}"[The maximum width of a single line in the output. Defaults to detecting screen size.]":"The maximum width of a single line in the output. Defaults to detecting screen size.": \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (backup_metadata)
      _arguments -s \
        --all"[Normally, this command only operates on books that have out of date OPF files. This option makes it operate on all books.]" \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (clone)
      _arguments -s \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (embed_metadata)
      _arguments -s \
        {--only-formats=,-f+}"[Only update metadata in files of the specified format. Specify it multiple times for multiple formats. By default, all formats are updated.]":"Only update metadata in files of the specified format. Specify it multiple times for multiple formats. By default, all formats are updated.": \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (search)
      _arguments -s \
        {--limit=,-l+}"[The maximum number of results to return. Default is all results.]":"The maximum number of results to return. Default is all results.": \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (fts_index)
      _arguments -s \
        --wait-for-completion"[Wait till all books are indexed, showing indexing progress periodically]" \
        --indexing-speed="[The speed of indexing. Use fast for fast indexing using all your computers resources and slow for less resource intensive indexing. Note that the speed is reset to slow after every invocation.]":"The speed of indexing. Use fast for fast indexing using all your computers resources and slow for less resource intensive indexing. Note that the speed is reset to slow after every invocation.":(fast|slow|) \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    (fts_search)
      _arguments -s \
        --include-snippets"[Include snippets of the text surrounding each match. Note that this makes searching much slower.]" \
        --match-start-marker="[The marker used to indicate the start of a matched word inside a snippet]":"The marker used to indicate the start of a matched word inside a snippet": \
        --match-end-marker="[The marker used to indicate the end of a matched word inside a snippet]":"The marker used to indicate the end of a matched word inside a snippet": \
        --do-not-match-on-related-words"[Only match on exact words not related words. So correction will not match correcting.]" \
        --restrict-to="[Restrict the searched books, either using a search expression or ids. For example\: ids\:1,2,3 to restrict by ids or search\:tag\:foo to restrict to books having the tag foo.]":"Restrict the searched books, either using a search expression or ids. For example\: ids\:1,2,3 to restrict by ids or search\:tag\:foo to restrict to books having the tag foo.": \
        --output-format="[The format to output the search results in. Either 'text' for plain text or 'json' for JSON output.]":"The format to output the search results in. Either 'text' for plain text or 'json' for JSON output.":(text|json) \
        --indexing-threshold="[How much of the library must be indexed before searching is allowed, as a percentage. Defaults to 90]":"How much of the library must be indexed before searching is allowed, as a percentage. Defaults to 90": \
        {--library-path=,--with-library=}"[Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.]":"Path to the calibre library. Default is to use the path stored in the settings. You can also connect to a calibre Content server to perform actions on remote libraries. To do so use a URL of the form\: http\://hostname\:port/#library_id for example, http\://localhost\:8080/#mylibrary. library_id is the library id of the library you want to connect to on the Content server. You can use the special library_id value of - to get a list of library ids available on the server. For details on how to setup access via a Content server, see https\://manual.calibre-ebook.com/generated/en/calibredb.html.":'_path_files -/' \
        '(- *)'{--help,-h}"[show this help message and exit]" \
        '(- *)'--version"[show program's version number and exit]" \
        --username="[Username for connecting to a calibre Content server]":"Username for connecting to a calibre Content server": \
        --password="[Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.]":"Password for connecting to a calibre Content server. To read the password from standard input, use the special value\: <stdin>. To read the password from a file, use\: <f\:/path/to/file> (i.e. <f\: followed by the full path to the file and a trailing >). The angle brackets in the above are required, remember to escape them or use quotes for your shell.": \
        --timeout="[The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.]":"The timeout, in seconds, when connecting to a calibre library over the network. The default is two minutes.": 
    ;;
    esac
    ;;
    esac

    return ret
    
}


_ebook_edit() {
    local curcontext="$curcontext" state line ebookfile expl
    typeset -A opt_args

    _arguments -C -s \
        "--version""[show program's version number and exit]" \
        {--help,-h}"[show this help message and exit]" \
        "--detach""[Detach from the controlling terminal, if any (Linux only)]" \
        "--select-text=""[The text to select in the book when it is opened for editing]" \
        "1:ebook file:_files -g '(#i)*.(AZW3|EPUB|docx|htm|html|xhtm|xhtml)'" \
        '*:file in ebook:->files' && return 0

    case $state in
        files)
            ebookfile=${~${(Q)line[1]}}

            if [[ -f "$ebookfile" && "$ebookfile" =~ '\.[eE][pP][uU][bB]$' ]]; then
                _zip_cache_name="$ebookfile"
                _zip_cache_list=( ${(f)"$(zipinfo -1 $_zip_cache_name 2>/dev/null)"} )
            else
                return 1
            fi
            _wanted files expl 'file from ebook' \
            _multi_parts / _zip_cache_list && return 0
            ;;
    esac

    return 1
}


case $service in
calibre)
_arguments -s \
  '(- *)'--version"[show program's version number and exit]" \
  '(- *)'{--help,-h}"[show this help message and exit]" \
  --with-library="[Use the library located at the specified path.]":"Use the library located at the specified path.":'_path_files -/' \
  --start-in-tray"[Start minimized to system tray.]" \
  {--verbose,-v}"[Ignored, do not use. Present only for legacy reasons]" \
  --no-update-check"[Do not check for updates]" \
  --ignore-plugins"[Ignore custom plugins, useful if you installed a plugin that is preventing calibre from starting]" \
  {--shutdown-running-calibre,-s}"[Cause a running calibre instance, if any, to be shutdown. Note that if there are running jobs, they will be silently aborted, so use with care.]" \
  --detach"[Detach from the controlling terminal, if any (Linux only)]" \
  "*:filename:_files -g '(#i)*.(azw|azw1|azw3|azw4|book|cb7|cbc|cbr|cbz|chm|djv|djvu|doc|docm|docx|epub|fb2|fbz|htm|html|htmlz|iba|ibook|ibooks|imp|kepub|kfx|kpf|lit|lrf|lrx|markdown|mbp|md|mobi|odt|oebzip|oxps|pdb|pdf|pdr|pml|pmlz|pobi|prc|ps|rar|rb|rtf|snb|tan|text|textile|tpz|txt|txtz|updb|xhtm|xhtml|xps|zbf|zip)'" 
;;
lrf2lrs)
_arguments -s \
  '(- *)'--version"[show program's version number and exit]" \
  '(- *)'{--help,-h}"[show this help message and exit]" \
  {--output=,-o+}"[Output LRS file]":"Output LRS file":'_files -g "*.LRS *.lrs"' \
  --dont-output-resources"[Do not save embedded image and font files to disk]" \
  --verbose"[Be more verbose]" \
  "*:filename:_files -g '(#i)*.(lrf)'" 
;;
ebook-meta)
_arguments -s \
  '(- *)'--version"[show program's version number and exit]" \
  '(- *)'{--help,-h}"[show this help message and exit]" \
  {--title=,-t+}"[Set the title.]":"Set the title.": \
  {--authors=,-a+}"[Set the authors. Multiple authors should be separated by the & character. Author names should be in the order Firstname Lastname.]":"Set the authors. Multiple authors should be separated by the & character. Author names should be in the order Firstname Lastname.": \
  --title-sort="[The version of the title to be used for sorting. If unspecified, and the title is specified, it will be auto-generated from the title.]":"The version of the title to be used for sorting. If unspecified, and the title is specified, it will be auto-generated from the title.": \
  --author-sort="[String to be used when sorting by author. If unspecified, and the author(s) are specified, it will be auto-generated from the author(s).]":"String to be used when sorting by author. If unspecified, and the author(s) are specified, it will be auto-generated from the author(s).": \
  --cover="[Set the cover to the specified file.]":"Set the cover to the specified file.":'_files -g "*.BMP *.GIF *.JPEG *.JPG *.PNG *.bmp *.gif *.jpeg *.jpg *.png"' \
  {--comments=,-c+}"[Set the e-book description.]":"Set the e-book description.": \
  {--publisher=,-p+}"[Set the e-book publisher.]":"Set the e-book publisher.": \
  --category="[Set the book category.]":"Set the book category.": \
  {--series=,-s+}"[Set the series this e-book belongs to.]":"Set the series this e-book belongs to.": \
  {--index=,-i+}"[Set the index of the book in this series.]":"Set the index of the book in this series.": \
  {--rating=,-r+}"[Set the rating. Should be a number between 1 and 5.]":"Set the rating. Should be a number between 1 and 5.": \
  --isbn="[Set the ISBN of the book.]":"Set the ISBN of the book.": \
  --identifier="[Set the identifiers for the book, can be specified multiple times. For example\: --identifier uri\:https\://acme.com --identifier isbn\:12345 To remove an identifier, specify no value, --identifier isbn\: Note that for EPUB files, an identifier marked as the package identifier cannot be removed.]":"Set the identifiers for the book, can be specified multiple times. For example\: --identifier uri\:https\://acme.com --identifier isbn\:12345 To remove an identifier, specify no value, --identifier isbn\: Note that for EPUB files, an identifier marked as the package identifier cannot be removed.": \
  --tags="[Set the tags for the book. Should be a comma separated list.]":"Set the tags for the book. Should be a comma separated list.": \
  {--book-producer=,-k+}"[Set the book producer.]":"Set the book producer.": \
  {--language=,-l+}"[Set the language.]":"Set the language.": \
  {--date=,-d+}"[Set the published date.]":"Set the published date.": \
  --get-cover="[Get the cover from the e-book and save it at as the specified file.]":"Get the cover from the e-book and save it at as the specified file.": \
  --disallow-rendered-cover"[For formats like EPUB that use a 'default cover' of the first page rendered, disallow such default covers]" \
  --to-opf="[Specify the name of an OPF file. The metadata will be written to the OPF file.]":"Specify the name of an OPF file. The metadata will be written to the OPF file.":'_files -g "*.opf"' \
  --from-opf="[Read metadata from the specified OPF file and use it to set metadata in the e-book. Metadata specified on the command line will override metadata read from the OPF file]":"Read metadata from the specified OPF file and use it to set metadata in the e-book. Metadata specified on the command line will override metadata read from the OPF file":'_files -g "*.opf"' \
  --lrf-bookid="[Set the BookID in LRF files]":"Set the BookID in LRF files": \
  "*:filename:_files -g '(#i)*.(azw|azw1|azw3|azw4|cb7|cbc|cbr|cbz|chm|docx|epub|fb2|fbz|html|htmlz|imp|lit|lrf|lrx|mobi|odt|oebzip|opf|pdb|pdf|pml|pmlz|pobi|prc|rar|rb|rtf|snb|tpz|txt|txtz|updb|zip)'" 
;;
ebook-polish)
_arguments -s \
  '(- *)'--version"[show program's version number and exit]" \
  '(- *)'{--help,-h}"[show this help message and exit]" \
  {--embed-fonts,-e}"[Embed all fonts that are referenced in the document and are not already embedded. This will scan your computer for the fonts, and if they are found, they will be embedded into the document. Please ensure that you have the proper license for embedding the fonts used in this document. ]" \
  {--subset-fonts,-f}"[Subsetting fonts means reducing an embedded font to contain only the characters used from that font in the book. This greatly reduces the size of the font files (halving the font file sizes is common). For example, if the book uses a specific font for headers, then subsetting will reduce that font to contain only the characters present in the actual headers in the book. Or if the book embeds the bold and italic versions of a font, but bold and italic text is relatively rare, or absent altogether, then the bold and italic fonts can either be reduced to only a few characters or completely removed. The only downside to subsetting fonts is that if, at a later date you decide to add more text to your books, the newly added text might not be covered by the subset font. ]" \
  {--cover=,-c+}"[Path to a cover image. Changes the cover specified in the e-book. If no cover is present, or the cover is not properly identified, inserts a new cover.]":"Path to a cover image. Changes the cover specified in the e-book. If no cover is present, or the cover is not properly identified, inserts a new cover.":'_files -g "*.BMP *.GIF *.JPEG *.JPG *.PNG *.bmp *.gif *.jpeg *.jpg *.png"' \
  {--opf=,-o+}"[Path to an OPF file. The metadata in the book is updated from the OPF file.]":"Path to an OPF file. The metadata in the book is updated from the OPF file.":'_files -g "*.opf"' \
  {--jacket,-j}"[Insert a 'book jacket' page at the start of the book that contains all the book metadata such as title, tags, authors, series, comments, etc. Any previous book jacket will be replaced.]" \
  --remove-jacket"[Remove a previous inserted book jacket page. ]" \
  {--smarten-punctuation,-p}"[Convert plain text dashes, ellipsis, quotes, multiple hyphens, etc. into their typographically correct equivalents. Note that the algorithm can sometimes generate incorrect results, especially when single quotes at the start of contractions are involved. ]" \
  {--remove-unused-css,-u}"[Remove all unused CSS rules from stylesheets and <style> tags. Some books created from production templates can have a large number of extra CSS rules that don't match any actual content. These extra rules can slow down readers that need to parse them all. ]" \
  {--compress-images,-i}"[Losslessly compress images in the book, to reduce the filesize, without affecting image quality. ]" \
  {--add-soft-hyphens,-H}"[Add soft hyphens to all words in the book. This allows the book to be rendered better when the text is justified, in readers that do not support hyphenation. ]" \
  --remove-soft-hyphens"[Remove soft hyphens from all text in the book. ]" \
  {--upgrade-book,-U}"[Upgrade the internal structures of the book, if possible. For instance, upgrades EPUB 2 books to EPUB 3 books. ]" \
  {--download-external-resources,-d}"[Download external resources such as images, stylesheets, etc. that point to URLs instead of files in the book. All such resources will be downloaded and added to the book so that the book no longer references any external resources. ]" \
  --verbose"[Produce more verbose output, useful for debugging.]" \
  "*:filename:_files -g '(#i)*.(azw3|epub)'" 
;;
lrfviewer)
_arguments -s \
  '(- *)'--version"[show program's version number and exit]" \
  '(- *)'{--help,-h}"[show this help message and exit]" \
  --verbose"[Print more information about the rendering process]" \
  --visual-debug"[Turn on visual aids to debugging the rendering engine]" \
  --disable-hyphenation"[Disable hyphenation. Should significantly speed up rendering.]" \
  --white-background"[By default the background is off white as I find this easier on the eyes. Use this option to make the background pure white.]" \
  --profile"[Profile the LRF renderer]" \
  "*:filename:_files -g '(#i)*.(lrf)'" 
;;
ebook-viewer)
_arguments -s \
  '(- *)'--version"[show program's version number and exit]" \
  '(- *)'{--help,-h}"[show this help message and exit]" \
  --raise-window"[If specified, the E-book viewer window will try to come to the front when started.]" \
  {--full-screen,--fullscreen,-f}"[If specified, the E-book viewer window will try to open full screen when started.]" \
  --force-reload"[Force reload of all opened books]" \
  --open-at="[The position at which to open the specified book. The position is a location or position you can get by using the Go to->Location action in the viewer controls. Alternately, you can use the form toc\:something and it will open at the location of the first Table of Contents entry that contains the string 'something'. The form toc-href\:something will match the href (internal link destination) of toc nodes. The matching is exact. If you want to match a substring, use the form toc-href-contains\:something. The form ref\:something will use Reference mode references. The form search\:something will search for something after opening the book. The form regex\:something will search for the regular expression something after opening the book.]":"The position at which to open the specified book. The position is a location or position you can get by using the Go to->Location action in the viewer controls. Alternately, you can use the form toc\:something and it will open at the location of the first Table of Contents entry that contains the string 'something'. The form toc-href\:something will match the href (internal link destination) of toc nodes. The matching is exact. If you want to match a substring, use the form toc-href-contains\:something. The form ref\:something will use Reference mode references. The form search\:something will search for something after opening the book. The form regex\:something will search for the regular expression something after opening the book.": \
  --continue"[Continue reading the last opened book]" \
  --new-instance"[Open a new viewer window even when the option to use only a single viewer window is set]" \
  --detach"[Detach from the controlling terminal, if any (Linux only)]" \
  "*:filename:_files -g '(#i)*.(azw|azw3|azw4|cb7|cbc|cbr|cbz|chm|djv|djvu|docm|docx|downloaded_recipe|epub|fb2|fbz|htm|html|htmlz|lit|lrf|markdown|md|mobi|odt|opf|pdb|pdf|pml|pmlz|pobi|prc|rb|recipe|rtf|shtm|shtml|snb|tcr|text|textile|txt|txtz|updb|xhtm|xhtml)'" 
;;
ebook-edit)
 _ebook_edit "$@"
;;
fetch-ebook-metadata)
_arguments -s \
  '(- *)'--version"[show program's version number and exit]" \
  '(- *)'{--help,-h}"[show this help message and exit]" \
  {--title=,-t+}"[Book title]":"Book title": \
  {--authors=,-a+}"[Book author(s)]":"Book author(s)": \
  {--isbn=,-i+}"[Book ISBN]":"Book ISBN": \
  {--identifier=,-I+}"[Identifiers such as ASIN/Goodreads id etc. Can be specified multiple times for multiple identifiers. For example\: --identifier asin\:B0082BAJA0]":"Identifiers such as ASIN/Goodreads id etc. Can be specified multiple times for multiple identifiers. For example\: --identifier asin\:B0082BAJA0": \
  {--verbose,-v}"[Print the log to the console (stderr)]" \
  {--opf,-o}"[Output the metadata in OPF format instead of human readable text.]" \
  {--cover=,-c+}"[Specify a filename. The cover, if available, will be saved to it. Without this option, no cover will be downloaded.]":"Specify a filename. The cover, if available, will be saved to it. Without this option, no cover will be downloaded.":'_files -g "*.BMP *.GIF *.JPEG *.JPG *.PNG *.bmp *.gif *.jpeg *.jpg *.png"' \
  {--timeout=,-d+}"[Timeout in seconds. Default is 30]":"Timeout in seconds. Default is 30": \
  {--allowed-plugin=,-p+}"[Specify the name of a metadata download plugin to use. By default, all metadata plugins will be used. Can be specified multiple times for multiple plugins. All plugin names\: Google, Google Images, Amazon.com, Edelweiss, Open Library, Big Book Search]":"Specify the name of a metadata download plugin to use. By default, all metadata plugins will be used. Can be specified multiple times for multiple plugins. All plugin names\: Google, Google Images, Amazon.com, Edelweiss, Open Library, Big Book Search": 
;;
calibre-smtp)
_arguments -s \
  '(- *)'--version"[show program's version number and exit]" \
  '(- *)'{--help,-h}"[show this help message and exit]" \
  {--localhost=,-l+}"[Host name of localhost. Used when connecting to SMTP server.]":"Host name of localhost. Used when connecting to SMTP server.": \
  {--outbox=,-o+}"[Path to maildir folder to store failed email messages in.]":"Path to maildir folder to store failed email messages in.":'_path_files -/' \
  {--fork,-f}"[Fork and deliver message in background. If you use this option, you should also use --outbox to handle delivery failures.]" \
  {--timeout=,-t+}"[Timeout for connection]":"Timeout for connection": \
  {--verbose,-v}"[Be more verbose]" \
  {--attachment=,-a+}"[File to attach to the email]":"File to attach to the email":_files \
  {--subject=,-s+}"[Subject of the email]":"Subject of the email": \
  {--relay=,-r+}"[An SMTP relay server to use to send mail.]":"An SMTP relay server to use to send mail.": \
  --port="[Port to connect to on relay server. Default is to use 465 if encryption method is SSL and 25 otherwise.]":"Port to connect to on relay server. Default is to use 465 if encryption method is SSL and 25 otherwise.": \
  {--username=,-u+}"[Username for relay]":"Username for relay": \
  {--password=,-p+}"[Password for relay]":"Password for relay": \
  {--encryption-method=,-e+}"[Encryption method to use when connecting to relay. Choices are TLS, SSL and NONE. Default is TLS. WARNING\: Choosing NONE is highly insecure]":"Encryption method to use when connecting to relay. Choices are TLS, SSL and NONE. Default is TLS. WARNING\: Choosing NONE is highly insecure":(TLS|SSL|NONE) \
  --dont-verify-server-certificate="[Do not verify the server certificate when connecting using TLS. This used to be the default behavior in calibre versions before 3.27. If you are using a relay with a self-signed or otherwise invalid certificate, you can use this option to restore the pre 3.27 behavior]":"Do not verify the server certificate when connecting using TLS. This used to be the default behavior in calibre versions before 3.27. If you are using a relay with a self-signed or otherwise invalid certificate, you can use this option to restore the pre 3.27 behavior": \
  --cafile="[Path to a file of concatenated CA certificates in PEM format, used to verify the server certificate when using TLS. By default, the system CA certificates are used.]":"Path to a file of concatenated CA certificates in PEM format, used to verify the server certificate when using TLS. By default, the system CA certificates are used.": 
;;
calibre-server)
_arguments -s \
  '(- *)'--version"[show program's version number and exit]" \
  '(- *)'{--help,-h}"[show this help message and exit]" \
  --ajax-timeout="[Time (in seconds) to wait for a response from the server when making queries.]":"Time (in seconds) to wait for a response from the server when making queries.": \
  {--enable-allow-socket-preallocation,--disable-allow-socket-preallocation}"[Socket pre-allocation, for example, with systemd socket activation. By default, this option is enabled.]" \
  {--enable-auth,--disable-auth}"[Password based authentication to access the server. 	Normally, the server is unrestricted, allowing anyone to access it. You can restrict access to predefined users with this option. By default, this option is disabled.]" \
  --auth-mode="[Choose the type of authentication used. 	Set the HTTP authentication mode used by the server. Set to 'basic' if you are putting this server behind an SSL proxy. Otherwise, leave it as 'auto', which will use 'basic' if SSL is configured otherwise it will use 'digest'.]":"Choose the type of authentication used. 	Set the HTTP authentication mode used by the server. Set to 'basic' if you are putting this server behind an SSL proxy. Otherwise, leave it as 'auto', which will use 'basic' if SSL is configured otherwise it will use 'digest'.":(auto|basic|digest) \
  --ban-after="[Number of login failures for ban. 	The number of login failures after which an IP address is banned]":"Number of login failures for ban. 	The number of login failures after which an IP address is banned": \
  --ban-for="[Ban IP addresses that have repeated login failures. 	Temporarily bans access for IP addresses that have repeated login failures for the specified number of minutes. Useful to prevent attempts at guessing passwords. If set to zero, no banning is done.]":"Ban IP addresses that have repeated login failures. 	Temporarily bans access for IP addresses that have repeated login failures for the specified number of minutes. Useful to prevent attempts at guessing passwords. If set to zero, no banning is done.": \
  --book-list-mode="[Choose the default book list mode. 	Set the default book list mode that will be used for new users. Individual users can override the default in their own settings. The default is to use a cover grid.]":"Choose the default book list mode. 	Set the default book list mode that will be used for new users. Individual users can override the default in their own settings. The default is to use a cover grid.":(cover_grid|custom_list|details_list) \
  --compress-min-size="[Minimum size for which responses use data compression (in bytes).]":"Minimum size for which responses use data compression (in bytes).": \
  --displayed-fields="[Restrict displayed user-defined fields. 	Comma separated list of user-defined metadata fields that will be displayed by the Content server in the /opds and /mobile views. If you specify this option, any fields not in this list will not be displayed. For example\: my_rating,my_tags]":"Restrict displayed user-defined fields. 	Comma separated list of user-defined metadata fields that will be displayed by the Content server in the /opds and /mobile views. If you specify this option, any fields not in this list will not be displayed. For example\: my_rating,my_tags": \
  {--enable-fallback-to-detected-interface,--disable-fallback-to-detected-interface}"[Fallback to auto-detected interface. 	If for some reason the server is unable to bind to the interface specified in the listen_on option, then it will try to detect an interface that connects to the outside world and bind to that. By default, this option is enabled.]" \
  --ignored-fields="[Ignored user-defined metadata fields. 	Comma separated list of user-defined metadata fields that will not be displayed by the Content server in the /opds and /mobile views. For example\: my_rating,my_tags]":"Ignored user-defined metadata fields. 	Comma separated list of user-defined metadata fields that will not be displayed by the Content server in the /opds and /mobile views. For example\: my_rating,my_tags": \
  --listen-on="[The interface on which to listen for connections. 	The default is to listen on all available IPv6 and IPv4 interfaces. You can change this to, for example, '127.0.0.1' to only listen for IPv4 connections from the local machine, or to '0.0.0.0' to listen to all incoming IPv4 connections.]":"The interface on which to listen for connections. 	The default is to listen on all available IPv6 and IPv4 interfaces. You can change this to, for example, '127.0.0.1' to only listen for IPv4 connections from the local machine, or to '0.0.0.0' to listen to all incoming IPv4 connections.": \
  {--enable-local-write,--disable-local-write}"[Allow un-authenticated local connections to make changes. 	Normally, if you do not turn on authentication, the server operates in read-only mode, so as to not allow anonymous users to make changes to your calibre libraries. This option allows anybody connecting from the same computer as the server is running on to make changes. This is useful if you want to run the server without authentication but still use calibredb to make changes to your calibre libraries. Note that turning on this option means any program running on the computer can make changes to your calibre libraries. By default, this option is disabled.]" \
  {--enable-log-not-found,--disable-log-not-found}"[Log HTTP 404 (Not Found) requests. 	Normally, the server logs all HTTP requests for resources that are not found. This can generate a lot of log spam, if your server is targeted by bots. Use this option to turn it off. By default, this option is enabled.]" \
  --max-header-line-size="[Max. size of single HTTP header (in KB).]":"Max. size of single HTTP header (in KB).": \
  --max-job-time="[Maximum time for worker processes. 	Maximum amount of time worker processes are allowed to run (in minutes). Set to zero for no limit.]":"Maximum time for worker processes. 	Maximum amount of time worker processes are allowed to run (in minutes). Set to zero for no limit.": \
  --max-jobs="[Maximum number of worker processes. 	Worker processes are launched as needed and used for large jobs such as preparing a book for viewing, adding books, converting, etc. Normally, the max. number of such processes is based on the number of CPU cores. You can control it by this setting.]":"Maximum number of worker processes. 	Worker processes are launched as needed and used for large jobs such as preparing a book for viewing, adding books, converting, etc. Normally, the max. number of such processes is based on the number of CPU cores. You can control it by this setting.": \
  --max-log-size="[Max. log file size (in MB). 	The maximum size of log files, generated by the server. When the log becomes larger than this size, it is automatically rotated. Set to zero to disable log rotation.]":"Max. log file size (in MB). 	The maximum size of log files, generated by the server. When the log becomes larger than this size, it is automatically rotated. Set to zero to disable log rotation.": \
  --max-opds-items="[Maximum number of books in OPDS feeds. 	The maximum number of books that the server will return in a single OPDS acquisition feed.]":"Maximum number of books in OPDS feeds. 	The maximum number of books that the server will return in a single OPDS acquisition feed.": \
  --max-opds-ungrouped-items="[Maximum number of ungrouped items in OPDS feeds. 	Group items in categories such as author/tags by first letter when there are more than this number of items. Set to zero to disable.]":"Maximum number of ungrouped items in OPDS feeds. 	Group items in categories such as author/tags by first letter when there are more than this number of items. Set to zero to disable.": \
  --max-request-body-size="[Max. allowed size for files uploaded to the server (in MB).]":"Max. allowed size for files uploaded to the server (in MB).": \
  --num-per-page="[Number of books to show in a single page. 	The number of books to show in a single page in the browser.]":"Number of books to show in a single page. 	The number of books to show in a single page in the browser.": \
  --port="[The port on which to listen for connections.]":"The port on which to listen for connections.": \
  --shutdown-timeout="[Total time in seconds to wait for clean shutdown.]":"Total time in seconds to wait for clean shutdown.": \
  --ssl-certfile="[Path to the SSL certificate file.]":"Path to the SSL certificate file.": \
  --ssl-keyfile="[Path to the SSL private key file.]":"Path to the SSL private key file.": \
  --timeout="[Time (in seconds) after which an idle connection is closed.]":"Time (in seconds) after which an idle connection is closed.": \
  --trusted-ips="[Allow un-authenticated connections from specific IP addresses to make changes. 	Normally, if you do not turn on authentication, the server operates in read-only mode, so as to not allow anonymous users to make changes to your calibre libraries. This option allows anybody connecting from the specified IP addresses to make changes. Must be a comma separated list of address or network specifications. This is useful if you want to run the server without authentication but still use calibredb to make changes to your calibre libraries. Note that turning on this option means anyone connecting from the specified IP addresses can make changes to your calibre libraries.]":"Allow un-authenticated connections from specific IP addresses to make changes. 	Normally, if you do not turn on authentication, the server operates in read-only mode, so as to not allow anonymous users to make changes to your calibre libraries. This option allows anybody connecting from the specified IP addresses to make changes. Must be a comma separated list of address or network specifications. This is useful if you want to run the server without authentication but still use calibredb to make changes to your calibre libraries. Note that turning on this option means anyone connecting from the specified IP addresses can make changes to your calibre libraries.": \
  --url-prefix="[A prefix to prepend to all URLs. 	Useful if you wish to run this server behind a reverse proxy. For example use, /calibre as the URL prefix.]":"A prefix to prepend to all URLs. 	Useful if you wish to run this server behind a reverse proxy. For example use, /calibre as the URL prefix.": \
  {--enable-use-bonjour,--disable-use-bonjour}"[Advertise OPDS feeds via BonJour. 	Advertise the OPDS feeds via the BonJour service, so that OPDS based reading apps can detect and connect to the server automatically. By default, this option is enabled.]" \
  {--enable-use-sendfile,--disable-use-sendfile}"[Zero copy file transfers for increased performance. 	This will use zero-copy in-kernel transfers when sending files over the network, increasing performance. However, it can cause corrupted file transfers on some broken filesystems. If you experience corrupted file transfers, turn it off. By default, this option is enabled.]" \
  --userdb="[Path to the user database to use for authentication. The database is a SQLite file. To create it use --manage-users. You can read more about managing users at\: https\://manual.calibre-ebook.com/server.html#managing-user-accounts-from-the-command-line-only]":"Path to the user database to use for authentication. The database is a SQLite file. To create it use --manage-users. You can read more about managing users at\: https\://manual.calibre-ebook.com/server.html#managing-user-accounts-from-the-command-line-only": \
  --worker-count="[Number of worker threads used to process requests.]":"Number of worker threads used to process requests.": \
  --log="[Path to log file for server log. This log contains server information and errors, not access logs. By default it is written to stdout.]":"Path to log file for server log. This log contains server information and errors, not access logs. By default it is written to stdout.": \
  --access-log="[Path to the access log file. This log contains information about clients connecting to the server and making requests. By default no access logging is done.]":"Path to the access log file. This log contains information about clients connecting to the server and making requests. By default no access logging is done.": \
  --custom-list-template="[Path to a JSON file containing a template for the custom book list mode. The easiest way to create such a template file is to go to Preferences-> Sharing over the net-> Book list template in calibre, create the template and export it.]":"Path to a JSON file containing a template for the custom book list mode. The easiest way to create such a template file is to go to Preferences-> Sharing over the net-> Book list template in calibre, create the template and export it.": \
  --search-the-net-urls="[Path to a JSON file containing URLs for the 'Search the internet' feature. The easiest way to create such a file is to go to Preferences-> Sharing over the net->Search the internet in calibre, create the URLs and export them.]":"Path to a JSON file containing URLs for the 'Search the internet' feature. The easiest way to create such a file is to go to Preferences-> Sharing over the net->Search the internet in calibre, create the URLs and export them.": \
  --daemonize"[Run process in background as a daemon (Linux only).]" \
  --pidfile="[Write process PID to the specified file]":"Write process PID to the specified file":_files \
  --auto-reload"[Automatically reload server when source code changes. Useful for development. You should also specify a small value for the shutdown timeout.]" \
  --manage-users"[Manage the database of users allowed to connect to this server. You can use it in automated mode by adding a --. See calibre-server --manage-users -- help for details. See also the --userdb option.]" 
;;
calibre-debug)
_arguments -s \
  '(- *)'--version"[show program's version number and exit]" \
  '(- *)'{--help,-h}"[show this help message and exit]" \
  {--command=,-c+}"[Run Python code.]":"Run Python code.": \
  {--exec-file=,-e+}"[Run the Python code in file.]":"Run the Python code in file.":'_files -g "*.PY *.RECIPE *.py *.recipe"' \
  {--subset-font,-f}"[Subset the specified font. Use -- after this option to pass option to the font subsetting program.]" \
  {--debug-device-driver,-d}"[Debug device detection]" \
  {--gui,-g}"[Run the GUI with debugging enabled. Debug output is printed to stdout and stderr.]" \
  --gui-debug="[Run the GUI with a debug console, logging to the specified path. For internal use only, use the -g option to run the GUI in debug mode]":"Run the GUI with a debug console, logging to the specified path. For internal use only, use the -g option to run the GUI in debug mode": \
  --run-without-debug"[Don't run with the DEBUG flag set]" \
  {--viewer,-w}"[Run the E-book viewer in debug mode]" \
  --paths"[Output the paths necessary to setup the calibre environment]" \
  --add-simple-plugin="[Add a simple plugin (i.e. a plugin that consists of only a .py file), by specifying the path to the py file containing the plugin code.]":"Add a simple plugin (i.e. a plugin that consists of only a .py file), by specifying the path to the py file containing the plugin code.":'_files -g "*.PY *.py"' \
  {--inspect-mobi,-m}"[Inspect the MOBI file(s) at the specified path(s)]" \
  --edit-book"[Launch the calibre 'Edit book' tool in debug mode.]" \
  {--explode-book,-x}"[Explode the book into the specified folder. Usage\: -x file.epub output_dir Exports the book as a collection of HTML files and metadata, which you can edit using standard HTML editing tools. Works with EPUB, AZW3, HTMLZ and DOCX files.]" \
  {--implode-book,-i}"[Implode a previously exploded book. Usage\: -i output_dir file.epub Imports the book from the files in output_dir which must have been created by a previous call to --explode-book. Be sure to specify the same file type as was used when exploding.]" \
  --export-all-calibre-data"[Export all calibre data (books/settings/plugins). Normally, you will be asked for the export folder and the libraries to export. You can also specify them as command line arguments to skip the questions. Use absolute paths for the export folder and libraries. The special keyword 'all' can be used to export all libraries. Examples\:    calibre-debug --export-all-calibre-data  # for interactive use   calibre-debug --export-all-calibre-data /path/to/empty/export/folder /path/to/library/folder1 /path/to/library2   calibre-debug --export-all-calibre-data /export/folder all  # export all known libraries]" \
  --import-calibre-data"[Import previously exported calibre data]" \
  {--shutdown-running-calibre,-s}"[Cause a running calibre instance, if any, to be shutdown. Note that if there are running jobs, they will be silently aborted, so use with care.]" \
  --test-build"[Test binary modules in build]" \
  {--run-plugin=,-r+}"[Run a plugin that provides a command line interface. For example\: calibre-debug -r 'Plugin name' -- file1 --option1 Everything after the -- will be passed to the plugin as arguments.]":"Run a plugin that provides a command line interface. For example\: calibre-debug -r 'Plugin name' -- file1 --option1 Everything after the -- will be passed to the plugin as arguments.": \
  {--run-test=,-t+}"[Run the named test(s). Use the special value 'all' to run all tests. If the test name starts with a period it is assumed to be a module name. If the test name starts with @ it is assumed to be a category name.]":"Run the named test(s). Use the special value 'all' to run all tests. If the test name starts with a period it is assumed to be a module name. If the test name starts with @ it is assumed to be a category name.": \
  --diff"[Run the calibre diff tool. For example\: calibre-debug --diff file1 file2]" \
  --default-programs="[(Un)register calibre from Windows Default Programs. --default-programs=(register|unregister)]":"(Un)register calibre from Windows Default Programs. --default-programs=(register|unregister)":(register|unregister) \
  --fix-multiprocessing"[For internal use]" \
  "*:filename:_files -g '(#i)*.(azw|azw3|docx|epub|mobi|py|recipe)'" 
;;
calibredb)
 _calibredb "$@"
;;
ebook-convert)
 _ebook_convert "$@"
;;
esac
