# stilts(1) completion                                     -*- shell-script -*-

_stilts_arrayjoin() {
    local args="help ifmt= istream= in= icmd= ocmd= omode= out= ofmt= atable= afmt= astream= acmd= keepall= aparams= cache= fixcols= suffixarray="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        afmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        acmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        fixcols)
            COMPREPLY=( $(compgen -W "none dups all" -- ${cur}) )
            ;;
        istream|astream|keepall|cache)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|out|atable|aparams|suffixarray)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_calc() {
    local args="help expression= table="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        expression|table)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_cdsskymatch() {
    local args="help ifmt= istream= in= icmd= ocmd= omode= out= ofmt= ra= dec= radius= cdstable= find= blocksize= maxrec= compress= serviceurl= usemoc= presort= fixcols= suffixin= suffixremote="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        find)
            COMPREPLY=( $(compgen -W "all best best-remote each each-dist" -- ${cur}) )
            ;;
        fixcols)
            COMPREPLY=( $(compgen -W "none dups all" -- ${cur}) )
            ;;
        istream|compress|usemoc|presort)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|out|ra|dec|radius|cdstable|blocksize|maxrec|serviceurl|suffixin|suffixremote)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_cone() {
    local args="help serviceurl= lon= lat= radius= skysys= servicetype= verb= compress= dataformat= ocmd= omode= out= ofmt="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        skysys)
            COMPREPLY=( $(compgen -W "icrs fk5 fk4 galactic supergalactic ecliptic" -- ${cur}) )
            ;;
        servicetype)
            COMPREPLY=( $(compgen -W "cone ssa sia1 sia2 sia" -- ${cur}) )
            ;;
        verb)
            COMPREPLY=( $(compgen -W "1 2 3" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        compress)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        serviceurl|lon|lat|radius|dataformat|out)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_coneskymatch() {
    local args="help ifmt= istream= in= icmd= ocmd= omode= out= ofmt= ra= dec= sr= find= usefoot= footnside= copycols= scorecol= parallel= erract= ostream= fixcols= suffix0= suffix1= servicetype= serviceurl= verb= dataformat= emptyok= compress="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        find)
            COMPREPLY=( $(compgen -W "best all each" -- ${cur}) )
            ;;
        erract)
            COMPREPLY=( $(compgen -W "abort ignore retry retry<n>" -- ${cur}) )
            ;;
        fixcols)
            COMPREPLY=( $(compgen -W "none dups all" -- ${cur}) )
            ;;
        servicetype)
            COMPREPLY=( $(compgen -W "cone ssa sia1 sia2 sia" -- ${cur}) )
            ;;
        verb)
            COMPREPLY=( $(compgen -W "1 2 3" -- ${cur}) )
            ;;
        istream|usefoot|ostream|emptyok|compress)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|out|ra|dec|sr|footnside|copycols|scorecol|parallel|suffix0|suffix1|serviceurl|dataformat)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_datalinklint() {
    local args="help votable= version= format= report= maxrepeat= truncate= debug="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        votable)
            COMPREPLY=( $(compgen -W "<filename> <URL> -" -- ${cur}) )
            ;;
        version)
            COMPREPLY=( $(compgen -W "1.0 1.1" -- ${cur}) )
            ;;
        format)
            COMPREPLY=( $(compgen -W "text json" -- ${cur}) )
            ;;
        debug)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        report|maxrepeat|truncate)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_funcs() {
    local args="help"
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_mocshape() {
    local args="help ifmt= istream= in= icmd= order= coords= shape= mocfmt= mocimpl= out="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        shape)
            COMPREPLY=( $(compgen -W "point circle polygon moc-ascii uniq stc-s" -- ${cur}) )
            ;;
        mocfmt)
            COMPREPLY=( $(compgen -W "ascii fits json raw summary cds_ascii cds_json cds_fits" -- ${cur}) )
            ;;
        mocimpl)
            COMPREPLY=( $(compgen -W "auto cds bits lists" -- ${cur}) )
            ;;
        istream)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|order|coords|out)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_pixfoot() {
    local args="help ifmt= istream= in= icmd= order= ra= dec= radius= mocfmt= out="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        mocfmt)
            COMPREPLY=( $(compgen -W "fits json ascii" -- ${cur}) )
            ;;
        istream)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|order|ra|dec|radius|out)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_pixsample() {
    local args="help in= ifmt= icmd= pixdata= pfmt= pcmd= ocmd= omode= out= ofmt= pixorder= stat= lon= lat= insys= pixsys= radius="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        pfmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        pcmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        pixorder)
            COMPREPLY=( $(compgen -W "nested ring (auto)" -- ${cur}) )
            ;;
        stat)
            COMPREPLY=( $(compgen -W "point mean" -- ${cur}) )
            ;;
        insys)
            COMPREPLY=( $(compgen -W "icrs fk5 fk4 galactic supergalactic ecliptic" -- ${cur}) )
            ;;
        pixsys)
            COMPREPLY=( $(compgen -W "icrs fk5 fk4 galactic supergalactic ecliptic" -- ${cur}) )
            ;;
        in|pixdata|out|lon|lat|radius)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_plot2d() {
    local args="help xpix= ypix= font= fontsize= fontstyle= legend= title= omode= out= ofmt= inN= ifmtN= istreamN= cmdN= xdataN= ydataN= auxdataN= xlo= ylo= auxlo= xhi= yhi= auxhi= xlog= ylog= auxlog= xflip= yflip= auxflip= xlabel= ylabel= auxlabel= xerrorN= yerrorN= auxshader= txtlabelN= subsetNS= nameNS= colourNS= shapeNS= sizeNS= transparencyNS= lineNS= linewidthNS= dashNS= hideNS= errstyleNS= grid= antialias= sequence="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        font)
            COMPREPLY=( $(compgen -W "dejavu_sans dejavu_sans_mono dejavu_serif dialog dialoginput monospaced sansserif serif" -- ${cur}) )
            ;;
        fontstyle)
            COMPREPLY=( $(compgen -W "plain bold italic bold-italic" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "swing out cgi discard auto" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "png png-transp gif jpeg pdf svg eps eps-gzip" -- ${cur}) )
            ;;
        ifmtN)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        cmdN)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        xerrorN)
            COMPREPLY=( $(compgen -W "<expr> [<lo-expr>],[<hi-expr>]" -- ${cur}) )
            ;;
        yerrorN)
            COMPREPLY=( $(compgen -W "<expr> [<lo-expr>],[<hi-expr>]" -- ${cur}) )
            ;;
        auxshader)
            COMPREPLY=( $(compgen -W "rainbow pastel standard heat colour hue greyscale red-blue hsv_h hsv_s hsv_v intensity rgb_red rgb_green rgb_blue yuv_y yuv_u yuv_v transparency" -- ${cur}) )
            ;;
        colourNS)
            COMPREPLY=( $(compgen -W "<rrggbb> red blue ..." -- ${cur}) )
            ;;
        shapeNS)
            COMPREPLY=( $(compgen -W "filled_circle open_circle cross x open_square open_diamond open_triangle_up open_triangle_down filled_square filled_diamond filled_triangle_up filled_triangle_down" -- ${cur}) )
            ;;
        lineNS)
            COMPREPLY=( $(compgen -W "DotToDot LinearRegression" -- ${cur}) )
            ;;
        dashNS)
            COMPREPLY=( $(compgen -W "dot dash ... <a,b,...>" -- ${cur}) )
            ;;
        errstyleNS)
            COMPREPLY=( $(compgen -W "none lines capped_lines caps arrows ellipse crosshair_ellipse rectangle crosshair_rectangle filled_ellipse filled_rectangle" -- ${cur}) )
            ;;
        legend|istreamN|xlog|ylog|auxlog|xflip|yflip|auxflip|hideNS|grid|antialias)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xpix|ypix|fontsize|title|out|inN|xdataN|ydataN|auxdataN|xlo|ylo|auxlo|xhi|yhi|auxhi|xlabel|ylabel|auxlabel|txtlabelN|subsetNS|nameNS|sizeNS|transparencyNS|linewidthNS|sequence)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_plot3d() {
    local args="help xpix= ypix= font= fontsize= fontstyle= legend= title= omode= out= ofmt= inN= ifmtN= istreamN= cmdN= xdataN= ydataN= zdataN= auxdataN= xlo= ylo= zlo= auxlo= xhi= yhi= zhi= auxhi= xlog= ylog= zlog= auxlog= xflip= yflip= zflip= auxflip= xlabel= ylabel= zlabel= auxlabel= xerrorN= yerrorN= zerrorN= auxshader= txtlabelN= subsetNS= nameNS= colourNS= shapeNS= sizeNS= transparencyNS= lineNS= linewidthNS= dashNS= hideNS= errstyleNS= grid= antialias= sequence= fog= phi= theta="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        font)
            COMPREPLY=( $(compgen -W "dejavu_sans dejavu_sans_mono dejavu_serif dialog dialoginput monospaced sansserif serif" -- ${cur}) )
            ;;
        fontstyle)
            COMPREPLY=( $(compgen -W "plain bold italic bold-italic" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "swing out cgi discard auto" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "png png-transp gif jpeg pdf svg eps eps-gzip" -- ${cur}) )
            ;;
        ifmtN)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        cmdN)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        xerrorN)
            COMPREPLY=( $(compgen -W "<expr> [<lo-expr>],[<hi-expr>]" -- ${cur}) )
            ;;
        yerrorN)
            COMPREPLY=( $(compgen -W "<expr> [<lo-expr>],[<hi-expr>]" -- ${cur}) )
            ;;
        zerrorN)
            COMPREPLY=( $(compgen -W "<expr> [<lo-expr>],[<hi-expr>]" -- ${cur}) )
            ;;
        auxshader)
            COMPREPLY=( $(compgen -W "rainbow pastel standard heat colour hue greyscale red-blue hsv_h hsv_s hsv_v intensity rgb_red rgb_green rgb_blue yuv_y yuv_u yuv_v transparency" -- ${cur}) )
            ;;
        colourNS)
            COMPREPLY=( $(compgen -W "<rrggbb> red blue ..." -- ${cur}) )
            ;;
        shapeNS)
            COMPREPLY=( $(compgen -W "filled_circle open_circle cross x open_square open_diamond open_triangle_up open_triangle_down filled_square filled_diamond filled_triangle_up filled_triangle_down" -- ${cur}) )
            ;;
        lineNS)
            COMPREPLY=( $(compgen -W "DotToDot LinearRegression" -- ${cur}) )
            ;;
        dashNS)
            COMPREPLY=( $(compgen -W "dot dash ... <a,b,...>" -- ${cur}) )
            ;;
        errstyleNS)
            COMPREPLY=( $(compgen -W "none lines capped_lines caps arrows cuboid ellipse crosshair_ellipse rectangle crosshair_rectangle filled_ellipse filled_rectangle" -- ${cur}) )
            ;;
        legend|istreamN|xlog|ylog|zlog|auxlog|xflip|yflip|zflip|auxflip|hideNS|grid|antialias)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xpix|ypix|fontsize|title|out|inN|xdataN|ydataN|zdataN|auxdataN|xlo|ylo|zlo|auxlo|xhi|yhi|zhi|auxhi|xlabel|ylabel|zlabel|auxlabel|txtlabelN|subsetNS|nameNS|sizeNS|transparencyNS|linewidthNS|sequence|fog|phi|theta)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_plothist() {
    local args="help xpix= ypix= font= fontsize= fontstyle= legend= title= omode= out= ofmt= inN= ifmtN= istreamN= cmdN= xdataN= xlo= xhi= xlog= xflip= xlabel= subsetNS= nameNS= colourNS= barstyleNS= linewidthNS= dashNS= grid= antialias= sequence= ylo= yhi= ylog= ylabel= weightN= binwidth= norm= cumulative= binbase="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        font)
            COMPREPLY=( $(compgen -W "dejavu_sans dejavu_sans_mono dejavu_serif dialog dialoginput monospaced sansserif serif" -- ${cur}) )
            ;;
        fontstyle)
            COMPREPLY=( $(compgen -W "plain bold italic bold-italic" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "swing out cgi discard auto" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "png png-transp gif jpeg pdf svg eps eps-gzip" -- ${cur}) )
            ;;
        ifmtN)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        cmdN)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        colourNS)
            COMPREPLY=( $(compgen -W "<rrggbb> red blue ..." -- ${cur}) )
            ;;
        barstyleNS)
            COMPREPLY=( $(compgen -W "fill open tops semi semitops spikes fillover openover" -- ${cur}) )
            ;;
        dashNS)
            COMPREPLY=( $(compgen -W "dot dash ... <a,b,...>" -- ${cur}) )
            ;;
        legend|istreamN|xlog|xflip|grid|antialias|ylog|norm|cumulative)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xpix|ypix|fontsize|title|out|inN|xdataN|xlo|xhi|xlabel|subsetNS|nameNS|linewidthNS|sequence|ylo|yhi|ylabel|weightN|binwidth|binbase)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_regquery() {
    local args="help query= regurl= soapout= ocmd= omode= out= ofmt="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        query|regurl|soapout|out)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_sqlclient() {
    local args="help db= user= password= sql= ofmt="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        db|user|password|sql)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_sqlskymatch() {
    local args="help ifmt= istream= in= icmd= ocmd= omode= out= ofmt= ra= dec= sr= find= usefoot= footnside= copycols= scorecol= erract= ostream= fixcols= suffix0= suffix1= db= user= password= dbtable= dbra= dbdec= dbunit= tiling= dbtile= selectcols= where= preparesql="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        find)
            COMPREPLY=( $(compgen -W "best all each" -- ${cur}) )
            ;;
        erract)
            COMPREPLY=( $(compgen -W "abort ignore retry retry<n>" -- ${cur}) )
            ;;
        fixcols)
            COMPREPLY=( $(compgen -W "none dups all" -- ${cur}) )
            ;;
        dbunit)
            COMPREPLY=( $(compgen -W "deg rad" -- ${cur}) )
            ;;
        tiling)
            COMPREPLY=( $(compgen -W "hpx<K> healpixnest<K> healpixring<K> htm<K>" -- ${cur}) )
            ;;
        istream|usefoot|ostream|preparesql)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|out|ra|dec|sr|footnside|copycols|scorecol|suffix0|suffix1|db|user|password|dbtable|dbra|dbdec|dbtile|selectcols|where)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_sqlupdate() {
    local args="help db= user= password= select= assign= progress="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        progress)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        db|user|password|select|assign)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_taplint() {
    local args="help tapurl= stages= maxtable= tables= format= report= maxrepeat= truncate= debug= interface= auth= syncurl= asyncurl= tablesurl= capabilitiesurl= availabilityurl= examplesurl="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        format)
            COMPREPLY=( $(compgen -W "text json" -- ${cur}) )
            ;;
        interface)
            COMPREPLY=( $(compgen -W "tap1.0 tap1.1 cap" -- ${cur}) )
            ;;
        debug|auth)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        tapurl|stages|maxtable|tables|report|maxrepeat|truncate|syncurl|asyncurl|tablesurl|capabilitiesurl|availabilityurl|examplesurl)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tapquery() {
    local args="help nupload= ufmtN= uploadN= ucmdN= ocmd= omode= out= ofmt= upnameN= tapurl= interface= auth= adql= parse= sync= maxrec= destruction= executionduration= compress= upvotformat= language= poll= progress= delete="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ufmtN)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        ucmdN)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        interface)
            COMPREPLY=( $(compgen -W "tap1.0 tap1.1 cap" -- ${cur}) )
            ;;
        upvotformat)
            COMPREPLY=( $(compgen -W "TABLEDATA BINARY BINARY2" -- ${cur}) )
            ;;
        delete)
            COMPREPLY=( $(compgen -W "finished never always now" -- ${cur}) )
            ;;
        auth|parse|sync|compress|progress)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        nupload|uploadN|out|upnameN|tapurl|adql|maxrec|destruction|executionduration|language|poll)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tapresume() {
    local args="help joburl= compress= poll= progress= delete= ocmd= omode= out= ofmt="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        delete)
            COMPREPLY=( $(compgen -W "finished never always now" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        compress|progress)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        joburl|poll|out)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tapskymatch() {
    local args="help ifmt= istream= in= icmd= ocmd= omode= out= ofmt= inlon= inlat= tapurl= interface= auth= taptable= taplon= taplat= tapcols= sr= find= blocksize= maxrec= sync= blockmaxrec= compress= fixcols= suffixin= suffixremote="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        interface)
            COMPREPLY=( $(compgen -W "tap1.0 tap1.1 cap" -- ${cur}) )
            ;;
        find)
            COMPREPLY=( $(compgen -W "all best each each-dist" -- ${cur}) )
            ;;
        fixcols)
            COMPREPLY=( $(compgen -W "none dups all" -- ${cur}) )
            ;;
        istream|auth|sync|compress)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|out|inlon|inlat|tapurl|taptable|taplon|taplat|tapcols|sr|blocksize|maxrec|blockmaxrec|suffixin|suffixremote)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tcat() {
    local args="help in= ifmt= multi= istream= icmd= ocmd= omode= out= ofmt= seqcol= loccol= uloccol= lazy= countrows="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        multi|istream|lazy|countrows)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|out|seqcol|loccol|uloccol)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tcatn() {
    local args="help nin= ifmtN= inN= icmdN= ocmd= omode= out= ofmt= seqcol= loccol= uloccol= countrows="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmtN)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmdN)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        countrows)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        nin|inN|out|seqcol|loccol|uloccol)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tcopy() {
    local args="help in= out= ifmt= ofmt="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        in|out)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tcube() {
    local args="help cols= ifmt= istream= in= icmd= bounds= binsizes= nbins= combine= out= otype= scale="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        combine)
            COMPREPLY=( $(compgen -W "sum sum-per-unit count count-per-unit mean median Q1 Q3 min max stdev stdev_pop hit" -- ${cur}) )
            ;;
        otype)
            COMPREPLY=( $(compgen -W "byte short int long float double" -- ${cur}) )
            ;;
        istream)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        cols|in|bounds|binsizes|nbins|out|scale)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tgridmap() {
    local args="help ifmt= istream= in= icmd= ocmd= omode= out= ofmt= coords= logs= bounds= binsizes= nbins= cols= combine= sparse= runner="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        logs)
            COMPREPLY=( $(compgen -W "true false ..." -- ${cur}) )
            ;;
        combine)
            COMPREPLY=( $(compgen -W "sum sum-per-unit count count-per-unit mean median Q1 Q3 min max stdev stdev_pop hit" -- ${cur}) )
            ;;
        runner)
            COMPREPLY=( $(compgen -W "sequential parallel partest" -- ${cur}) )
            ;;
        istream|sparse)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|out|coords|bounds|binsizes|nbins|cols)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tgroup() {
    local args="help ifmt= istream= in= icmd= ocmd= omode= out= ofmt= keys= aggcols= runner= sort= cache="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        runner)
            COMPREPLY=( $(compgen -W "sequential parallel partest" -- ${cur}) )
            ;;
        istream|sort|cache)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|out|keys|aggcols)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tjoin() {
    local args="help nin= ifmtN= inN= icmdN= ocmd= omode= out= ofmt= fixcols= suffixN="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmtN)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmdN)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        fixcols)
            COMPREPLY=( $(compgen -W "none dups all" -- ${cur}) )
            ;;
        nin|inN|out|suffixN)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tloop() {
    local args="help ocmd= omode= out= ofmt= colname= start= end= step= forcefloat="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        forcefloat)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        out|colname|start|end|step)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tmatch1() {
    local args="help matcher= params= tuning= values= action= progress= runner= ifmt= istream= in= icmd= ocmd= omode= out= ofmt="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        action)
            COMPREPLY=( $(compgen -W "identify keep0 keep1 wide2 wideN" -- ${cur}) )
            ;;
        progress)
            COMPREPLY=( $(compgen -W "none log time profile" -- ${cur}) )
            ;;
        runner)
            COMPREPLY=( $(compgen -W "parallel parallel-all sequential classic partest" -- ${cur}) )
            ;;
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        istream)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        matcher|params|tuning|values|in|out)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tmatch2() {
    local args="help in1= ifmt1= in2= ifmt2= icmd1= icmd2= ocmd= omode= out= ofmt= matcher= values1= values2= params= tuning= join= find= fixcols= suffix1= suffix2= scorecol= progress= runner="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt1)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        ifmt2)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd1)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        icmd2)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        join)
            COMPREPLY=( $(compgen -W "1and2 1or2 all1 all2 1not2 2not1 1xor2" -- ${cur}) )
            ;;
        find)
            COMPREPLY=( $(compgen -W "all best best1 best2" -- ${cur}) )
            ;;
        fixcols)
            COMPREPLY=( $(compgen -W "none dups all" -- ${cur}) )
            ;;
        progress)
            COMPREPLY=( $(compgen -W "none log time profile" -- ${cur}) )
            ;;
        runner)
            COMPREPLY=( $(compgen -W "parallel parallel-all sequential classic partest" -- ${cur}) )
            ;;
        in1|in2|out|matcher|values1|values2|params|tuning|suffix1|suffix2|scorecol)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tmatchn() {
    local args="help nin= ifmtN= inN= icmdN= ocmd= omode= out= ofmt= multimode= iref= matcher= params= tuning= valuesN= joinN= fixcols= suffixN= progress= runner="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmtN)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmdN)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        multimode)
            COMPREPLY=( $(compgen -W "pairs group" -- ${cur}) )
            ;;
        joinN)
            COMPREPLY=( $(compgen -W "default match nomatch always" -- ${cur}) )
            ;;
        fixcols)
            COMPREPLY=( $(compgen -W "none dups all" -- ${cur}) )
            ;;
        progress)
            COMPREPLY=( $(compgen -W "none log time profile" -- ${cur}) )
            ;;
        runner)
            COMPREPLY=( $(compgen -W "parallel parallel-all sequential classic partest" -- ${cur}) )
            ;;
        nin|inN|out|iref|matcher|params|tuning|valuesN|suffixN)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tmulti() {
    local args="help in= ifmt= multi= istream= icmd= out= ofmt="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        multi|istream)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|out)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tmultin() {
    local args="help nin= ifmtN= inN= icmdN= out= ofmt="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmtN)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmdN)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        nin|inN|out)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tpipe() {
    local args="help ifmt= istream= in= cmd= omode= out= ofmt="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        cmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        istream)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|out)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tskymap() {
    local args="help ifmt= istream= in= icmd= ocmd= omode= out= ofmt= lon= lat= tiling= count= cols= combine= perunit= complete= runner="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        icmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ocmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        tiling)
            COMPREPLY=( $(compgen -W "hpx<K> healpixnest<K> healpixring<K> htm<K>" -- ${cur}) )
            ;;
        combine)
            COMPREPLY=( $(compgen -W "sum sum-per-unit count count-per-unit mean median Q1 Q3 min max stdev stdev_pop hit" -- ${cur}) )
            ;;
        perunit)
            COMPREPLY=( $(compgen -W "steradian degree2 arcmin2 arcsec2 mas2 uas2" -- ${cur}) )
            ;;
        runner)
            COMPREPLY=( $(compgen -W "sequential parallel partest" -- ${cur}) )
            ;;
        istream|count|complete)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|out|lon|lat|cols)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_tskymatch2() {
    local args="help in1= ifmt1= in2= ifmt2= omode= out= ofmt= ra1= dec1= ra2= dec2= error= tuning= join= find= runner="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        ifmt1)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        ifmt2)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        omode)
            COMPREPLY=( $(compgen -W "out meta stats count checksum cgi discard topcat samp tosql gui" -- ${cur}) )
            ;;
        ofmt)
            COMPREPLY=( $(compgen -W "jdbc fits colfits votable fits-healpix text ascii CSV IPAC HTML LaTeX TST" -- ${cur}) )
            ;;
        join)
            COMPREPLY=( $(compgen -W "1and2 1or2 all1 all2 1not2 2not1 1xor2" -- ${cur}) )
            ;;
        find)
            COMPREPLY=( $(compgen -W "all best best1 best2" -- ${cur}) )
            ;;
        runner)
            COMPREPLY=( $(compgen -W "parallel parallel-all sequential classic partest" -- ${cur}) )
            ;;
        in1|in2|out|ra1|dec1|ra2|dec2|error|tuning)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_votcopy() {
    local args="help in= out= format= version= charset= cache= href= nomagic= base="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        format)
            COMPREPLY=( $(compgen -W "TABLEDATA BINARY BINARY2 FITS" -- ${cur}) )
            ;;
        version)
            COMPREPLY=( $(compgen -W "1.0 1.1 1.2 1.3 1.4 1.5" -- ${cur}) )
            ;;
        charset)
            COMPREPLY=( $(compgen -W "Big5 Big5-HKSCS CESU-8 EUC-JP EUC-KR GB18030 GB2312 GBK IBM-Thai IBM00858 IBM01140 IBM01141 IBM01142 IBM01143 IBM01144 IBM01145 IBM01146 IBM01147 IBM01148 IBM01149 IBM037 IBM1026 IBM1047 IBM273 IBM277 IBM278 IBM280 IBM284 IBM285 IBM290 IBM297 IBM420 IBM424 IBM437 IBM500 IBM775 IBM850 IBM852 IBM855 IBM857 IBM860 IBM861 IBM862 IBM863 IBM864 IBM865 IBM866 IBM868 IBM869 IBM870 IBM871 IBM918 ISO-2022-CN ISO-2022-JP ISO-2022-JP-2 ISO-2022-KR ISO-8859-1 ISO-8859-13 ISO-8859-15 ISO-8859-16 ISO-8859-2 ISO-8859-3 ISO-8859-4 ISO-8859-5 ISO-8859-6 ISO-8859-7 ISO-8859-8 ISO-8859-9 JIS_X0201 JIS_X0212-1990 KOI8-R KOI8-U Shift_JIS TIS-620 US-ASCII UTF-16 UTF-16BE UTF-16LE UTF-32 UTF-32BE UTF-32LE UTF-8 windows-1250 windows-1251 windows-1252 windows-1253 windows-1254 windows-1255 windows-1256 windows-1257 windows-1258 windows-31j x-Big5-HKSCS-2001 x-Big5-Solaris x-euc-jp-linux x-EUC-TW x-eucJP-Open x-IBM1006 x-IBM1025 x-IBM1046 x-IBM1097 x-IBM1098 x-IBM1112 x-IBM1122 x-IBM1123 x-IBM1124 x-IBM1129 x-IBM1166 x-IBM1364 x-IBM1381 x-IBM1383 x-IBM29626C x-IBM300 x-IBM33722 x-IBM737 x-IBM833 x-IBM834 x-IBM856 x-IBM874 x-IBM875 x-IBM921 x-IBM922 x-IBM930 x-IBM933 x-IBM935 x-IBM937 x-IBM939 x-IBM942 x-IBM942C x-IBM943 x-IBM943C x-IBM948 x-IBM949 x-IBM949C x-IBM950 x-IBM964 x-IBM970 x-ISCII91 x-ISO-2022-CN-CNS x-ISO-2022-CN-GB x-iso-8859-11 x-JIS0208 x-JISAutoDetect x-Johab x-MacArabic x-MacCentralEurope x-MacCroatian x-MacCyrillic x-MacDingbat x-MacGreek x-MacHebrew x-MacIceland x-MacRoman x-MacRomania x-MacSymbol x-MacThai x-MacTurkish x-MacUkraine x-MS932_0213 x-MS950-HKSCS x-MS950-HKSCS-XP x-mswin-936 x-PCK x-SJIS_0213 x-UTF-16LE-BOM X-UTF-32BE-BOM X-UTF-32LE-BOM x-windows-50220 x-windows-50221 x-windows-874 x-windows-949 x-windows-950 x-windows-iso2022jp" -- ${cur}) )
            ;;
        cache|href|nomagic)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        in|out|base)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_votlint() {
    local args="help votable= ucd= unit= maxrepeat= validate= version= out="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        votable)
            COMPREPLY=( $(compgen -f -- ${cur}) $(compgen -d -- ${cur}) )
            ;;
        version)
            COMPREPLY=( $(compgen -W "1.0 1.1 1.2 1.3 1.4 1.5" -- ${cur}) )
            ;;
        ucd|unit|validate)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        maxrepeat|out)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_xsdvalidate() {
    local args="help doc= schemaloc= topel= verbose= uselocals="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        doc)
            COMPREPLY=( $(compgen -f -- ${cur}) $(compgen -d -- ${cur}) )
            ;;
        verbose|uselocals)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        schemaloc|topel)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_plot2plane() {
    local args="help xpix= ypix= insets= omode= storage= seq= legend= legborder= legopaque= legseq= legpos= title= auxmap= auxclip= auxflip= auxquant= auxfunc= auxmin= auxmax= auxlabel= auxcrowd= auxwidth= auxvisible= forcebitmap= compositor= animate= afmt= astream= acmd= parallel= xlog= ylog= xflip= yflip= xlabel= ylabel= x2func= y2func= x2label= y2label= aspect= grid= xcrowd= ycrowd= labelangle= minor= shadow= gridcolor= gridtrans= labelcolor= texttype= fontsize= fontstyle= fontweight= xmin= xmax= xsub= ymin= ymax= ysub= navaxes= xanchor= yanchor= zoomfactor= leglabelN= layerN="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        omode)
            COMPREPLY=( $(compgen -W "swing out cgi discard auto" -- ${cur}) )
            ;;
        storage)
            COMPREPLY=( $(compgen -W "simple memory disk policy cache basic-cache persistent parallel" -- ${cur}) )
            ;;
        auxmap)
            COMPREPLY=( $(compgen -W "<map-name> <color>-<color>[-<color>...]" -- ${cur}) )
            ;;
        auxflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        auxfunc)
            COMPREPLY=( $(compgen -W "log linear histogram histolog sqrt square acos cos" -- ${cur}) )
            ;;
        afmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        acmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        xlog)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        ylog)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        yflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        grid)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        labelangle)
            COMPREPLY=( $(compgen -W "horizontal angled adaptive" -- ${cur}) )
            ;;
        minor)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        shadow)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        gridcolor)
            COMPREPLY=( $(compgen -W "<rrggbb> red blue ..." -- ${cur}) )
            ;;
        labelcolor)
            COMPREPLY=( $(compgen -W "<rrggbb> red blue ..." -- ${cur}) )
            ;;
        texttype)
            COMPREPLY=( $(compgen -W "plain antialias latex" -- ${cur}) )
            ;;
        fontstyle)
            COMPREPLY=( $(compgen -W "standard serif mono" -- ${cur}) )
            ;;
        fontweight)
            COMPREPLY=( $(compgen -W "plain bold italic bold_italic" -- ${cur}) )
            ;;
        navaxes)
            COMPREPLY=( $(compgen -W "xy x y" -- ${cur}) )
            ;;
        xanchor)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        yanchor)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        layerN)
            COMPREPLY=( $(compgen -W "mark size sizexy xyvector xyerror xyellipse xycorr link2 mark2 poly4 mark4 polygon area central lines marks handles yerrors xyerrors statline statmark arrayquantile line linearfit label arealabel contour grid fill quantile histogram kde knn densogram gaussian function" -- ${cur}) )
            ;;
        legend|legborder|legopaque|auxvisible|forcebitmap|astream)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xpix|ypix|insets|seq|legseq|legpos|title|auxclip|auxquant|auxmin|auxmax|auxlabel|auxcrowd|auxwidth|compositor|animate|parallel|xlabel|ylabel|x2func|y2func|x2label|y2label|aspect|xcrowd|ycrowd|gridtrans|fontsize|xmin|xmax|xsub|ymin|ymax|ysub|zoomfactor|leglabelN)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_plot2sky() {
    local args="help xpix= ypix= insets= omode= storage= seq= legend= legborder= legopaque= legseq= legpos= title= auxmap= auxclip= auxflip= auxquant= auxfunc= auxmin= auxmax= auxlabel= auxcrowd= auxwidth= auxvisible= forcebitmap= compositor= animate= afmt= astream= acmd= parallel= projection= viewsys= reflectlon= grid= scalebar= labelpos= sex= crowd= gridcolor= gridtrans= labelcolor= gridaa= texttype= fontsize= fontstyle= fontweight= clon= clat= radius= zoomfactor= leglabelN= layerN= datasysN="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        omode)
            COMPREPLY=( $(compgen -W "swing out cgi discard auto" -- ${cur}) )
            ;;
        storage)
            COMPREPLY=( $(compgen -W "simple memory disk policy cache basic-cache persistent parallel" -- ${cur}) )
            ;;
        auxmap)
            COMPREPLY=( $(compgen -W "<map-name> <color>-<color>[-<color>...]" -- ${cur}) )
            ;;
        auxflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        auxfunc)
            COMPREPLY=( $(compgen -W "log linear histogram histolog sqrt square acos cos" -- ${cur}) )
            ;;
        afmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        acmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        projection)
            COMPREPLY=( $(compgen -W "sin aitoff aitoff0 car car0" -- ${cur}) )
            ;;
        viewsys)
            COMPREPLY=( $(compgen -W "equatorial galactic supergalactic ecliptic" -- ${cur}) )
            ;;
        reflectlon)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        grid)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        scalebar)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        labelpos)
            COMPREPLY=( $(compgen -W "Auto External Internal ..." -- ${cur}) )
            ;;
        sex)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        gridcolor)
            COMPREPLY=( $(compgen -W "<rrggbb> red blue ..." -- ${cur}) )
            ;;
        labelcolor)
            COMPREPLY=( $(compgen -W "<rrggbb> red blue ..." -- ${cur}) )
            ;;
        gridaa)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        texttype)
            COMPREPLY=( $(compgen -W "plain antialias latex" -- ${cur}) )
            ;;
        fontstyle)
            COMPREPLY=( $(compgen -W "standard serif mono" -- ${cur}) )
            ;;
        fontweight)
            COMPREPLY=( $(compgen -W "plain bold italic bold_italic" -- ${cur}) )
            ;;
        layerN)
            COMPREPLY=( $(compgen -W "mark size sizexy skyvector skyellipse skycorr link2 mark2 poly4 mark4 polygon area central label arealabel contour skydensity healpix skygrid" -- ${cur}) )
            ;;
        datasysN)
            COMPREPLY=( $(compgen -W "equatorial galactic supergalactic ecliptic" -- ${cur}) )
            ;;
        legend|legborder|legopaque|auxvisible|forcebitmap|astream)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xpix|ypix|insets|seq|legseq|legpos|title|auxclip|auxquant|auxmin|auxmax|auxlabel|auxcrowd|auxwidth|compositor|animate|parallel|crowd|gridtrans|fontsize|clon|clat|radius|zoomfactor|leglabelN)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_plot2cube() {
    local args="help xpix= ypix= insets= omode= storage= seq= legend= legborder= legopaque= legseq= legpos= title= auxmap= auxclip= auxflip= auxquant= auxfunc= auxmin= auxmax= auxlabel= auxcrowd= auxwidth= auxvisible= forcebitmap= compositor= animate= afmt= astream= acmd= parallel= xlog= ylog= zlog= xflip= yflip= zflip= isometric= xlabel= ylabel= zlabel= xcrowd= ycrowd= zcrowd= labelangle= frame= minor= gridaa= texttype= fontsize= fontstyle= fontweight= xmin= xmax= xsub= ymin= ymax= ysub= zmin= zmax= zsub= phi= theta= psi= zoom= xoff= yoff= zoomaxes= zoomfactor= leglabelN= layerN= geomN="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        omode)
            COMPREPLY=( $(compgen -W "swing out cgi discard auto" -- ${cur}) )
            ;;
        storage)
            COMPREPLY=( $(compgen -W "simple memory disk policy cache basic-cache persistent parallel" -- ${cur}) )
            ;;
        auxmap)
            COMPREPLY=( $(compgen -W "<map-name> <color>-<color>[-<color>...]" -- ${cur}) )
            ;;
        auxflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        auxfunc)
            COMPREPLY=( $(compgen -W "log linear histogram histolog sqrt square acos cos" -- ${cur}) )
            ;;
        afmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        acmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        xlog)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        ylog)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        zlog)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        yflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        zflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        isometric)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        labelangle)
            COMPREPLY=( $(compgen -W "horizontal angled adaptive" -- ${cur}) )
            ;;
        frame)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        minor)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        gridaa)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        texttype)
            COMPREPLY=( $(compgen -W "plain antialias latex" -- ${cur}) )
            ;;
        fontstyle)
            COMPREPLY=( $(compgen -W "standard serif mono" -- ${cur}) )
            ;;
        fontweight)
            COMPREPLY=( $(compgen -W "plain bold italic bold_italic" -- ${cur}) )
            ;;
        layerN)
            COMPREPLY=( $(compgen -W "mark size sizexy xyzvector xyzerror link2 mark2 poly4 mark4 polygon label line3d contour spheregrid" -- ${cur}) )
            ;;
        geomN)
            COMPREPLY=( $(compgen -W "components vector polar" -- ${cur}) )
            ;;
        legend|legborder|legopaque|auxvisible|forcebitmap|astream)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xpix|ypix|insets|seq|legseq|legpos|title|auxclip|auxquant|auxmin|auxmax|auxlabel|auxcrowd|auxwidth|compositor|animate|parallel|xlabel|ylabel|zlabel|xcrowd|ycrowd|zcrowd|fontsize|xmin|xmax|xsub|ymin|ymax|ysub|zmin|zmax|zsub|phi|theta|psi|zoom|xoff|yoff|zoomaxes|zoomfactor|leglabelN)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_plot2sphere() {
    local args="help xpix= ypix= insets= omode= storage= seq= legend= legborder= legopaque= legseq= legpos= title= auxmap= auxclip= auxflip= auxquant= auxfunc= auxmin= auxmax= auxlabel= auxcrowd= auxwidth= auxvisible= forcebitmap= compositor= animate= afmt= astream= acmd= parallel= crowd= labelangle= frame= minor= gridaa= texttype= fontsize= fontstyle= fontweight= cx= cy= cz= scale= phi= theta= psi= zoom= xoff= yoff= zoomfactor= leglabelN= layerN="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        omode)
            COMPREPLY=( $(compgen -W "swing out cgi discard auto" -- ${cur}) )
            ;;
        storage)
            COMPREPLY=( $(compgen -W "simple memory disk policy cache basic-cache persistent parallel" -- ${cur}) )
            ;;
        auxmap)
            COMPREPLY=( $(compgen -W "<map-name> <color>-<color>[-<color>...]" -- ${cur}) )
            ;;
        auxflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        auxfunc)
            COMPREPLY=( $(compgen -W "log linear histogram histolog sqrt square acos cos" -- ${cur}) )
            ;;
        afmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        acmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        labelangle)
            COMPREPLY=( $(compgen -W "horizontal angled adaptive" -- ${cur}) )
            ;;
        frame)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        minor)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        gridaa)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        texttype)
            COMPREPLY=( $(compgen -W "plain antialias latex" -- ${cur}) )
            ;;
        fontstyle)
            COMPREPLY=( $(compgen -W "standard serif mono" -- ${cur}) )
            ;;
        fontweight)
            COMPREPLY=( $(compgen -W "plain bold italic bold_italic" -- ${cur}) )
            ;;
        layerN)
            COMPREPLY=( $(compgen -W "mark size sizexy link2 mark2 poly4 mark4 polygon area central label arealabel line3d contour spheregrid" -- ${cur}) )
            ;;
        legend|legborder|legopaque|auxvisible|forcebitmap|astream)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xpix|ypix|insets|seq|legseq|legpos|title|auxclip|auxquant|auxmin|auxmax|auxlabel|auxcrowd|auxwidth|compositor|animate|parallel|crowd|fontsize|cx|cy|cz|scale|phi|theta|psi|zoom|xoff|yoff|zoomfactor|leglabelN)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_plot2corner() {
    local args="help xpix= ypix= insets= omode= storage= seq= legend= legborder= legopaque= legseq= legpos= title= auxmap= auxclip= auxflip= auxquant= auxfunc= auxmin= auxmax= auxlabel= auxcrowd= auxwidth= auxvisible= forcebitmap= compositor= animate= afmt= astream= acmd= parallel= nvar= matrixformat= cellgap= squares= xKlog= xKflip= xKlabel= grid= xcrowd= labelangle= minor= shadow= gridcolor= gridtrans= labelcolor= texttype= fontsize= fontstyle= fontweight= xKmin= xKmax= xKsub= navaxes= xKanchor= zoomfactor= leglabelN= layerN="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        omode)
            COMPREPLY=( $(compgen -W "swing out cgi discard auto" -- ${cur}) )
            ;;
        storage)
            COMPREPLY=( $(compgen -W "simple memory disk policy cache basic-cache persistent parallel" -- ${cur}) )
            ;;
        auxmap)
            COMPREPLY=( $(compgen -W "<map-name> <color>-<color>[-<color>...]" -- ${cur}) )
            ;;
        auxflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        auxfunc)
            COMPREPLY=( $(compgen -W "log linear histogram histolog sqrt square acos cos" -- ${cur}) )
            ;;
        afmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        acmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        squares)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xKlog)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xKflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        grid)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        labelangle)
            COMPREPLY=( $(compgen -W "horizontal angled adaptive" -- ${cur}) )
            ;;
        minor)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        shadow)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        gridcolor)
            COMPREPLY=( $(compgen -W "<rrggbb> red blue ..." -- ${cur}) )
            ;;
        labelcolor)
            COMPREPLY=( $(compgen -W "<rrggbb> red blue ..." -- ${cur}) )
            ;;
        texttype)
            COMPREPLY=( $(compgen -W "plain antialias latex" -- ${cur}) )
            ;;
        fontstyle)
            COMPREPLY=( $(compgen -W "standard serif mono" -- ${cur}) )
            ;;
        fontweight)
            COMPREPLY=( $(compgen -W "plain bold italic bold_italic" -- ${cur}) )
            ;;
        navaxes)
            COMPREPLY=( $(compgen -W "xy x y" -- ${cur}) )
            ;;
        xKanchor)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        layerN)
            COMPREPLY=( $(compgen -W "mark line linearfit label contour grid fill quantile histogram kde knn densogram gaussian function" -- ${cur}) )
            ;;
        legend|legborder|legopaque|auxvisible|forcebitmap|astream)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xpix|ypix|insets|seq|legseq|legpos|title|auxclip|auxquant|auxmin|auxmax|auxlabel|auxcrowd|auxwidth|compositor|animate|parallel|nvar|matrixformat|cellgap|xKlabel|xcrowd|gridtrans|fontsize|xKmin|xKmax|xKsub|zoomfactor|leglabelN)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}

_stilts_plot2time() {
    local args="help xpix= ypix= insets= omode= storage= seq= legend= legborder= legopaque= legseq= legpos= title= auxmap= auxclip= auxflip= auxquant= auxfunc= auxmin= auxmax= auxlabel= auxcrowd= auxwidth= auxvisible= forcebitmap= compositor= animate= afmt= astream= acmd= parallel= cellgap= ylog= yflip= tlabel= ylabel= t2func= y2func= t2label= y2label= grid= tcrowd= ycrowd= labelangle= tformat= minor= shadow= gridcolor= gridtrans= texttype= fontsize= fontstyle= fontweight= tmin= tmax= tsub= ymin= ymax= ysub= navaxes= zoomfactor= leglabelN= layerN= zoneN="
    local cur="${COMP_WORDS[$COMP_CWORD]/=/}"
    local prev="${COMP_WORDS[COMP_CWORD-1]}"
    if [[ $prev == "=" ]] ; then
        prev="${COMP_WORDS[COMP_CWORD-2]}"
    fi
    case $prev in
        omode)
            COMPREPLY=( $(compgen -W "swing out cgi discard auto" -- ${cur}) )
            ;;
        storage)
            COMPREPLY=( $(compgen -W "simple memory disk policy cache basic-cache persistent parallel" -- ${cur}) )
            ;;
        auxmap)
            COMPREPLY=( $(compgen -W "<map-name> <color>-<color>[-<color>...]" -- ${cur}) )
            ;;
        auxflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        auxfunc)
            COMPREPLY=( $(compgen -W "log linear histogram histolog sqrt square acos cos" -- ${cur}) )
            ;;
        afmt)
            COMPREPLY=( $(compgen -W "FITS-plus colfits-plus colfits-basic FITS VOTable MRT ASCII CSV TST IPAC WDC" -- ${cur}) )
            ;;
        acmd)
            COMPREPLY=( $(compgen -W "addcol addpixsample addresolve addskycoords assert badval cache check clearparams collapsecols colmeta constcol delcols every explodecols explodeall fixcolnames group head healpixmeta keepcols meta progress random randomview repeat replacecol replaceval rowrange select seqview setparam shuffle sort sorthead stats tablename tail transpose uniq" -- ${cur}) )
            ;;
        ylog)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        yflip)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        grid)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        labelangle)
            COMPREPLY=( $(compgen -W "horizontal angled adaptive" -- ${cur}) )
            ;;
        tformat)
            COMPREPLY=( $(compgen -W "iso-8601 year mjd unix" -- ${cur}) )
            ;;
        minor)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        shadow)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        gridcolor)
            COMPREPLY=( $(compgen -W "<rrggbb> red blue ..." -- ${cur}) )
            ;;
        texttype)
            COMPREPLY=( $(compgen -W "plain antialias latex" -- ${cur}) )
            ;;
        fontstyle)
            COMPREPLY=( $(compgen -W "standard serif mono" -- ${cur}) )
            ;;
        fontweight)
            COMPREPLY=( $(compgen -W "plain bold italic bold_italic" -- ${cur}) )
            ;;
        navaxes)
            COMPREPLY=( $(compgen -W "t y ty" -- ${cur}) )
            ;;
        layerN)
            COMPREPLY=( $(compgen -W "line linearfit mark fill quantile grid histogram kde knn densogram gaussian yerror spectrogram label function" -- ${cur}) )
            ;;
        legend|legborder|legopaque|auxvisible|forcebitmap|astream)
            COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
            ;;
        xpix|ypix|insets|seq|legseq|legpos|title|auxclip|auxquant|auxmin|auxmax|auxlabel|auxcrowd|auxwidth|compositor|animate|parallel|cellgap|tlabel|ylabel|t2func|y2func|t2label|y2label|tcrowd|ycrowd|gridtrans|fontsize|tmin|tmax|tsub|ymin|ymax|ysub|zoomfactor|leglabelN|zoneN)
            COMPREPLY=( )
            ;;
        *)
            compopt -o nospace
            COMPREPLY=( $(compgen -W "$args" -- $cur) )
            ;;
    esac
}
_stilts() {
    local tasks="arrayjoin calc cdsskymatch cone coneskymatch datalinklint funcs mocshape pixfoot pixsample plot2d plot3d plothist regquery sqlclient sqlskymatch sqlupdate taplint tapquery tapresume tapskymatch tcat tcatn tcopy tcube tgridmap tgroup tjoin tloop tmatch1 tmatch2 tmatchn tmulti tmultin tpipe tskymap tskymatch2 votcopy votlint xsdvalidate plot2plane plot2sky plot2cube plot2sphere plot2corner plot2time"
    local args="-help -version -verbose -allowunused -prompt -bench -debug -batch -memory -disk -memgui -checkversion -stdout -stderr"
    local cur="${COMP_WORDS[$COMP_CWORD]}"
    local cmd="stilts"
    for w in ${COMP_WORDS[@]} ; do
        for t in $tasks; do
            if [[ "$w" == "$t" ]] ; then
                cmd=stilts_"$w"
            fi
        done
    done
    case $cmd in
        stilts)
            if [[ "$cur" == -* ]] ; then
                COMPREPLY=( $(compgen -W "$args" -- $cur) )
            else
                COMPREPLY=( $(compgen -W "$tasks" -- $cur) )
            fi
            ;;
        *)
            _${cmd}
            ;;
      esac
} &&
complete -F _stilts stilts

# ex: ts=4 sw=4 et filetype=sh
