#/usr/bin/env bash

fontsList="abeezee abel abhayalibre abrilfatface aclonica acme actor adamina adventpro aguafinascript akayakanadaka akayatelivigala akronim aladin alata alatsi aldrich alef alegreya alegreyasc alegreyasans alegreyasanssc aleo alexbrush alfaslabone alice alike alikeangular allan allerta allertastencil allison allura almarai almendra almendradisplay almendrasc alumnisans amarante amaranth amaticsc amethysta amiko amiri amita anaheim andadapro andika andikanewbasic angkor annieuseyourtelescope anonymouspro antic anticdidone anticslab anton antonio arapey arbutus arbutusslab architectsdaughter archivo archivoblack archivonarrow areyouserious arefruqaa arimamadurai arimo arizonia armata arsenal artifika arvo arya asap asapcondensed asar asset assistant astloch asul athiti atkinsonhyperlegible atma atomicage aubrey audiowide autourone average averagesans averiagruesalibre averialibre averiasanslibre averiaseriflibre azeretmono b612 b612mono badscript bahiana bahianita baijamjuree bakbakone ballet baloo2 baloobhai2 baloobhaijaan2 baloobhaina2 baloochettan2 balooda2 baloopaaji2 balootamma2 balootammudu2 baloothambi2 balsamiqsans balthazar bangers barlow barlowcondensed barlowsemicondensed barriecito barrio basic baskervville battambang baumans bayon bevietnampro bebasneue belgrano bellefair belleza bellota bellotatext benchnine benne bentham berkshireswash besley bethellen bevan bigshouldersdisplay bigshouldersinlinedisplay bigshouldersinlinetext bigshouldersstencildisplay bigshouldersstenciltext bigshoulderstext bigelowrules bigshotone bilbo bilboswashcaps biorhyme biorhymeexpanded birthstone birthstonebounce biryani bitter blackandwhitepicture blackhansans blackopsone blinker bodonimoda bokor bonanova bonbon bonheurroyale boogaloo bowlbyone bowlbyonesc brawler breeserif brygada1918 bubblegumsans bubblerone buda buenard bungee bungeehairline bungeeinline bungeeoutline bungeeshade butcherman butterflykids cabin cabincondensed cabinsketch caesardressing cagliostro cairo caladea calistoga calligraffitti cambay cambo candal cantarell cantataone cantoraone capriola caramel carattere cardo carme carroisgothic carroisgothicsc carterone castoro catamaran caudex caveat caveatbrush cedarvillecursive cevicheone chakrapetch changa changaone chango charm charmonman chathura chauphilomeneone chelaone chelseamarket chenla cherish cherrycreamsoda cherryswash chewy chicle chilanka chivo chonburi cinzel cinzeldecorative clickerscript coda codacaption codystar coiny combo comfortaa comforter comforterbrush comicneue comingsoon commissioner concertone condiment content contrailone convergence cookie copse corben corinthia cormorant cormorantgaramond cormorantinfant cormorantsc cormorantunicase cormorantupright courgette courierprime cousine coustard coveredbyyourgrace craftygirls creepster creteround crimsonpro croissantone crushed cuprum cutefont cutive cutivemono dmmono dmsans dmserifdisplay dmseriftext damion dancingscript dangrek darkergrotesque davidlibre dawningofanewday daysone dekko delagothicone delius deliusswashcaps deliusunicase dellarespira denkone devonshire dhurjati didactgothic diplomata diplomatasc dohyeon dokdo domine donegalone dongle doppioone dorsa dosis dotgothic16 drsugiyama durusans dynalight ebgaramond eaglelake eastseadokdo eater economica eczar elmessiri electrolize elsie elsieswashcaps emblemaone emilyscandy encodesans encodesanscondensed encodesansexpanded encodesanssc encodesanssemicondensed encodesanssemiexpanded engagement englebert enriqueta ephesis epilogue ericaone esteban estonia euphoriascript ewert exo exo2 expletussans explora fahkwang fanwoodtext farro farsan fascinate fascinateinline fasterone fasthand faunaone faustina federant federo felipa fenix festive fingerpaint firacode firamono firasans firasanscondensed firasansextracondensed fjallaone fjordone flamenco flavors fleurdeleah flowblock flowcircular flowrounded fondamento fontdinerswanky forum francoisone frankruhllibre fraunces freckleface frederickathegreat fredokaone freehand fresca frijole fruktur fugazone fuggles fuzzybubbles gfsdidot gfsneohellenic gabriela gaegu gafata galada galdeano galindo gamjaflower gayathri gelasio gemunulibre genos gentiumbasic gentiumbookbasic geo georama geostar geostarfill germaniaone gideonroman gidugu gildadisplay girassol giveyouglory glassantiqua glegoo gloriahallelujah glory gluten goblinone gochihand goldman gorditas gothica1 gotu goudybookletter1911 gowunbatang gowundodum graduate grandhotel grandstander gravitasone greatvibes grechenfuemen grenze grenzegotisch greyqo griffy gruppo gudea gugi gupter gurajada gwendolyn habibi hachimarupop hahmlet halant hammersmithone hanalei hanaleifill handlee hanuman happymonkey harmattan headlandone heebo hennypenny heptaslab herrvonmuellerhoff himelody hinamincho hind hindguntur hindmadurai hindsiliguri hindvadodara holtwoodonesc homemadeapple homenaje hurricane ibmplexmono ibmplexsans ibmplexsansarabic ibmplexsanscondensed ibmplexsansdevanagari ibmplexsanshebrew ibmplexsanskr ibmplexsansthai ibmplexsansthailooped ibmplexserif imfelldwpica imfelldwpicasc imfelldoublepica imfelldoublepicasc imfellenglish imfellenglishsc imfellfrenchcanon imfellfrenchcanonsc imfellgreatprimer imfellgreatprimersc ibarrarealnova iceberg iceland imbue imperialscript imprima inconsolata inder indieflower inika inknutantiqua inriasans inriaserif inspiration inter irishgrover islandmoments istokweb italiana italianno itim jacquesfrancois jacquesfrancoisshadow jaldi jetbrainsmono jimnightshade jockeyone jollylodger jomhuria jomolhari josefinsans josefinslab jost jotione jua judson julee juliussansone junge jura justanotherhand justmeagaindownhere k2d kadwa kaiseidecol kaiseiharunoumi kaiseiopti kaiseitokumin kalam kameron kanit kantumruy karantina karla karma katibeh kaushanscript kavivanar kavoon kdamthmor keaniaone kellyslab kenia khand khmer khula kings kiranghaerang kiteone kiwimaru kleeone knewave koho kodchasan kohsantepheap kolkerbrush kosugi kosugimaru kottaone koulen kranky kreon kristi kronaone krub kufam kulimpark kumarone kumaroneoutline kumbhsans kurale labelleaurore lacquer laila lakkireddy lalezar lancelot langar lateef lato leaguescript leckerlione ledger lekton lemon lemonada lexend lexenddeca lexendexa lexendgiga lexendmega lexendpeta lexendtera lexendzetta librebarcode128 librebarcode128text librebarcode39 librebarcode39extended librebarcode39extendedtext librebarcode39text librebarcodeean13text librebaskerville librecaslondisplay librecaslontext librefranklin licorice lifesavers lilitaone lilyscriptone limelight lindenhill literata liujianmaocao livvic lobster lobstertwo londrinaoutline londrinashadow londrinasketch londrinasolid longcang lora lovelight loveyalikeasister lovedbytheking loversquarrel luckiestguy lusitana lustria luxuriousroman luxuriousscript mplus1 mplus1code mplus1p mplus2 mpluscodelatin mplusrounded1c mashanzheng macondo macondoswashcaps mada magra maidenorange maitree majormonodisplay mako mali mallanna mandali manjari manrope mansalva manuale marcellus marcellussc marckscript margarine markazitext markoone marmelad martel martelsans marvel mate matesc mavenpro mclaren meaculpa meddon medievalsharp medulaone meerainimai megrim meiescript meowscript merienda meriendaone merriweather merriweathersans metal metalmania metamorphous metrophobic michroma milonga miltonian miltoniantattoo mina miniver miriamlibre mirza missfajardose mitr mochiypopone mochiypoppone modak modernantiqua mogra mohave molengo molle monda monofett monoton monsieurladoulaise montaga montaguslab montecarlo montez montserrat montserratalternates montserratsubrayada moolahlah moondance moul moulpali mountainsofchristmas mousememoirs mrbedfort mrdafoe mrdehaviland mrssaintdelafield mrssheppards mukta muktamahee muktamalar muktavaani mulish murecho museomoderno mysteryquest ntr nanumbrushscript nanumgothic nanumgothiccoding nanummyeongjo nanumpenscript nerkoone neucha neuton newrocker newtegomin newscycle newsreader niconne niramit nixieone nobile nokora norican nosifer notable nothingyoucoulddo noticiatext notokufiarabic notomusic notonaskharabic notonastaliqurdu notorashihebrew notosans notosansadlam notosansadlamunjoined notosansanatolianhieroglyphs notosansarabic notosansarmenian notosansavestan notosansbalinese notosansbamum notosansbassavah notosansbatak notosansbengali notosansbhaiksuki notosansbrahmi notosansbuginese notosansbuhid notosanscanadianaboriginal notosanscarian notosanscaucasianalbanian notosanschakma notosanscham notosanscherokee notosanscoptic notosanscuneiform notosanscypriot notosansdeseret notosansdevanagari notosansdisplay notosansduployan notosansegyptianhieroglyphs notosanselbasan notosanselymaic notosansgeorgian notosansglagolitic notosansgothic notosansgrantha notosansgujarati notosansgunjalagondi notosansgurmukhi notosanshk notosanshanifirohingya notosanshanunoo notosanshatran notosanshebrew notosansimperialaramaic notosansindicsiyaqnumbers notosansinscriptionalpahlavi notosansinscriptionalparthian notosansjp notosansjavanese notosanskr notosanskaithi notosanskannada notosanskayahli notosanskharoshthi notosanskhmer notosanskhojki notosanskhudawadi notosanslao notosanslepcha notosanslimbu notosanslineara notosanslinearb notosanslisu notosanslycian notosanslydian notosansmahajani notosansmalayalam notosansmandaic notosansmanichaean notosansmarchen notosansmasaramgondi notosansmath notosansmayannumerals notosansmedefaidrin notosansmeeteimayek notosansmeroitic notosansmiao notosansmodi notosansmongolian notosansmono notosansmro notosansmultani notosansmyanmar notosansnko notosansnabataean notosansnewtailue notosansnewa notosansnushu notosansogham notosansolchiki notosansoldhungarian notosansolditalic notosansoldnortharabian notosansoldpermic notosansoldpersian notosansoldsogdian notosansoldsoutharabian notosansoldturkic notosansoriya notosansosage notosansosmanya notosanspahawhhmong notosanspalmyrene notosanspaucinhau notosansphagspa notosansphoenician notosanspsalterpahlavi notosansrejang notosansrunic notosanssc notosanssamaritan notosanssaurashtra notosanssharada notosansshavian notosanssiddham notosanssinhala notosanssogdian notosanssorasompeng notosanssoyombo notosanssundanese notosanssylotinagri notosanssymbols notosanssymbols2 notosanssyriac notosanstc notosanstagalog notosanstagbanwa notosanstaile notosanstaitham notosanstaiviet notosanstakri notosanstamil notosanstamilsupplement notosanstelugu notosansthaana notosansthai notosansthailooped notosanstifinagh notosanstirhuta notosansugaritic notosansvai notosanswancho notosanswarangciti notosansyi notosanszanabazarsquare notoserif notoserifahom notoserifarmenian notoserifbalinese notoserifbengali notoserifdevanagari notoserifdisplay notoserifdogra notoserifethiopic notoserifgeorgian notoserifgrantha notoserifgujarati notoserifgurmukhi notoserifhebrew notoserifjp notoserifkr notoserifkannada notoserifkhmer notoseriflao notoserifmalayalam notoserifmyanmar notoserifnyiakengpuachuehmong notoserifsc notoserifsinhala notoseriftc notoseriftamil notoseriftangut notoseriftelugu notoserifthai notoseriftibetan notoserifyezidi nototraditionalnushu novacut novaflat novamono novaoval novaround novascript novaslim novasquare numans nunito nunitosans odibeesans odormeanchey offside oi oldstandardtt oldenburg ole oleoscript oleoscriptswashcaps ooohbaby opensans opensanscondensed oranienbaum orbitron oregano orelegaone orienta originalsurfer oswald otomanopeeone outfit overtherainbow overlock overlocksc overpass overpassmono ovo oxanium oxygen oxygenmono ptmono ptsans ptsanscaption ptsansnarrow ptserif ptserifcaption pacifico padauk palanquin palanquindark palettemosaic pangolin paprika parisienne passeroone passionone passionsconflict pathwaygothicone patrickhand patrickhandsc pattaya patuaone pavanam paytoneone peddana peralta permanentmarker petemoss petitformalscript petrona philosopher piazzolla piedra pinyonscript pirataone plaster play playball playfairdisplay playfairdisplaysc podkova poiretone pollerone poly pompiere pontanosans poorstory poppins portlligatsans portlligatslab pottaone pragatinarrow praise prata preahvihear pressstart2p pridi princesssofia prociono prompt prostoone prozalibre publicsans puppiesplay puritan purplepurse pushster qahiri quando quantico quattrocento quattrocentosans questrial quicksand quintessential qwigley qwitchergrypen racingsansone radley rajdhani rakkas raleway ralewaydots ramabhadra ramaraja rambla rammettoone rampartone ranchers rancho ranga rasa rationale raviprakash readexpro recursive redhatdisplay redhatmono redhattext redrose redacted redactedscript redressed reemkufi reeniebeanie reggaeone revalia rhodiumlibre ribeye ribeyemarrow righteous risque roadrage roboto robotocondensed robotomono robotoslab rochester rock3d rocksalt rocknrollone rokkitt romanesco ropasans rosario rosarivo rougescript rowdies rozhaone rubik rubikbeastly rubikmonoone ruda rufina rugeboogie ruluko rumraisin ruslandisplay russoone ruthie rye stixtwotext sacramento sahitya sail saira sairacondensed sairaextracondensed sairasemicondensed sairastencilone salsa sanchez sancreek sansita sansitaswashed sarabun sarala sarina sarpanch sassyfrass satisfy sawarabigothic sawarabimincho scada scheherazadenew schoolbell scopeone seaweedscript secularone sedgwickave sedgwickavedisplay sen sevillana seymourone shadowsintolight shadowsintolighttwo shalimar shanti share sharetech sharetechmono shipporiantique shipporiantiqueb1 shipporimincho shipporiminchob1 shizuru shojumaru shortstack shrikhand siemreap sigmarone signika signikanegative simonetta singleday sintony sirinstencil sixcaps skranji slabo13px slabo27px slackey smokum smooch smythe sniglet snippet snowburstone sofadione sofia solway songmyung sonsieone sora sortsmillgoudy sourcecodepro sourcesans3 sourcesanspro sourceserif4 sourceserifpro spacegrotesk spacemono spartan specialelite spectral spectralsc spicyrice spinnaker spirax splinesans squadaone sreekrushnadevaraya sriracha srisakdi staatliches stalemate stalinistone stardosstencil stick sticknobills stintultracondensed stintultraexpanded stoke strait stylescript stylish sueellenfrancisco suezone sulphurpoint sumana sunflower sunshiney supermercadoone sura suranna suravaram suwannaphum swankyandmoomoo syncopate syne synemono synetactile tajawal tangerine taprom tauri taviraj teko telex tenaliramakrishna tenorsans textmeone texturina thasadith thegirlnextdoor thenautigal tienne tillana timmana tinos titanone titilliumweb tomorrow tourney tradewinds trainone trirong trispace trocchi trochut truculenta trykker tulpenone turretroad twinklestar ubuntu ubuntucondensed ubuntumono uchen ultra uncialantiqua underdog unicaone unifrakturcook unifrakturmaguntia unkempt unlock unna urbanist vt323 vampiroone varela varelaround varta vastshadow vesperlibre viaodalibre vibes vibur vidaloka viga voces volkhov vollkorn vollkornsc voltaire vujahdayscript waitingforthesunrise wallpoet walterturncoat warnes waterfall wellfleet wendyone windsong wireone worksans xanhmono yaldevi yanonekaffeesatz yantramanav yatraone yellowtail yeonsung yesevaone yesteryear yomogi yrsa yujiboku yujihentaiganaakari yujihentaiganaakebono yujimai yujisyuku yuseimagic zcoolkuaile zcoolqingkehuangyou zcoolxiaowei zenantique zenantiquesoft zendots zenkakugothicantique zenkakugothicnew zenkurenaido zenloop zenmarugothic zenoldmincho zentokyozoo zeyada zhimangxing zillaslab zillaslabhighlight"

_gfinstall()
{
        local cur prev opts
        cur="${COMP_WORDS[COMP_CWORD]}"
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        opts="--help --version --local"

        totalArgs=${#COMP_WORDS[@]}
        case $totalArgs in
        2)
                # This will be returned when user is trying to auto-complete options
                if [[ ${cur} == -* ]] ; then
                        COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
                        return 0
                fi

                COMPREPLY=($(compgen -W "${fontsList}" "${COMP_WORDS[1]}"))
                return 0
                ;;
        3)
                # This will be returned when user is trying to auto-complete when --local was passed
                if [[ ${prev} == --local ]] || [[ ${prev} == -l ]]; then
                        COMPREPLY=($(compgen -W "${fontsList}" "${COMP_WORDS[2]}"))
                        return 0
                fi

                COMPREPLY=()
                return 0
                ;;
        *)
                COMPREPLY=()
                return 0
                ;;
        esac
}

complete -F _gfinstall gfinstall