/*
    This file is part of GNU APL, a free implementation of the
    ISO/IEC Standard 13751, "Programming Language APL, Extended"

    Copyright © 2008-2020  Dr. Jürgen Sauermann

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


/* definition of APL commands and the functions that implement them.

   command:        the string for the command
   implementation: the Command::cmd_XXX() function that implements the commands
   arguments:      command arguments (in the )HELP command
   \t expansion:   TAB expansion hint (ExpandHint in TabExpansion.hh)

   keep it sorted in such a way that longer prefixes come first !!!
 */
//──────────────────────────────────────────────────────────────────────────────────────────────────────
//      command     ,  implementation                           ,argument(s)               ,\t expansion 
//──────────────────,────────,──────────────────────────────────,──────────────────────────,────────────
cmd_def(")CHECK"    , Command::cmd_CHECK(out, arg)              ,"[BRIEF]"                 ,NO_PARAM   )
cmd_def(")CLEAR"    , Command::cmd_CLEAR(out)                   ,""                        ,NO_PARAM   )
cmd_def(")CONTINUE" , Command::cmd_CONTINUE(out)                ,""                        ,NO_PARAM   )
cmd_def(")COPY_ONCE", Command::cmd_COPY_ONCE(out, args)         ,"[[lib] wsname]"          ,oLIB_WSNAME)
cmd_def(")COPY"     , Command::cmd_COPY(out, args, false)       ,"[lib] wsname [object...]",oLIB_WSNAME)
cmd_def(")DROP"     , Command::cmd_DROP(out, args)              ,"[lib] wsname"            ,oLIB_WSNAME)
cmd_def(")DUMP-HTML", Command::cmd_DUMP(out, args, true,  false),"[[lib] wsname]"          ,oLIB_WSNAME)
cmd_def(")DUMPV"    , Command::cmd_DUMP(out, args, false, false),"[[lib] wsname]"          ,oLIB_WSNAME)
cmd_def(")DUMP"     , Command::cmd_DUMP(out, args, false, true) ,"[[lib] wsname]"          ,oLIB_WSNAME)
cmd_def(")ERASE"    , Command::cmd_ERASE(out, args)             ,"symbol ..."              ,SYMBOLS    )
cmd_def(")FNS"      , Command::cmd_FNS(out, arg)                ,"[from-to]"               ,oFROM_oTO  )
cmd_def(")HELP"     , Command::cmd_HELP(out, arg)               ,"[primitive]"             ,PRIMITIVE  )
cmd_def(")HISTORY"  , Command::cmd_HISTORY(out, arg)            ,"[CLEAR]"                 ,oCLEAR     )
cmd_def(")HOST"     , Command::cmd_HOST(out, arg)               ,"command ..."             ,HOSTCMD    )
cmd_def(")IN"       , Cmd_IN::cmd_IN(out, args, false)          ,"filename [object...]"    ,FILENAME   )
cmd_def(")LIBS"     , Cmd_LIB::cmd_LIBS(out, args)              ,"[[lib] path]"            ,oLIB_oPATH )
cmd_def(")LIB"      , Cmd_LIB::cmd_LIB1(out, args)              ,"[lib|path] [from-to]"    ,DIR_OR_LIB )
cmd_def(")LOAD"     , Command::cmd_LOAD(out, args, line, false) ,"[lib] wsname"            ,oLIB_WSNAME)
cmd_def(")MORE"     , Command::cmd_MORE(out, args)              ,"[AUTO [ON|OFF]]"         ,oAUTO      )
cmd_def(")NMS"      , Command::cmd_NMS(out, arg)                ,"[from-to]"               ,oFROM_oTO  )
cmd_def(")OFF"      , Command::cmd_OFF(arg.atoi())              ,"[exit_code]"             ,COUNT      )
cmd_def(")OPS"      , Command::cmd_OPS(out, arg)                ,"[from-to]"               ,oFROM_oTO  )
cmd_def(")OUT"      , Command::cmd_OUT(out, args)               ,"filename [object...]"    ,FILENAME   )
cmd_def(")PCOPY"    , Command::cmd_COPY(out, args, true)        ,"[lib] wsname [object]"   ,oLIB_WSNAME)
cmd_def(")PIN"      , Cmd_IN::cmd_IN(out, args, true)           ,"filename [object...]"    ,FILENAME   )
cmd_def(")QLOAD"    , Command::cmd_LOAD(out, args, line, true)  ,"[lib] wsname"            ,oLIB_WSNAME)
cmd_def(")RESET"    , Command::cmd_SIC(out)                     ,""                        ,NO_PARAM   )
cmd_def(")SAVE"     , Command::cmd_SAVE(out, args)              ,"[[lib] wsname]"          ,oLIB_WSNAME)
cmd_def(")SIC"      , Command::cmd_SIC(out)                     ,""                        ,NO_PARAM   )
cmd_def(")SINL"     , Command::cmd_SINL(out)                    ,""                        ,NO_PARAM   )
cmd_def(")SIS"      , Command::cmd_SIS(out, false)              ,""                        ,NO_PARAM   )
cmd_def(")SI"       , Command::cmd_SI(out, false)               ,""                        ,NO_PARAM   )
cmd_def(")SYMBOLS"  , Command::cmd_SYMBOLS(out, arg)            ,"[count]"                 ,COUNT      )
cmd_def(")VALUES"   , Command::cmd_VALUES(out)                  ,""                        ,NO_PARAM   )
cmd_def(")VARS"     , Command::cmd_VARS(out, arg)               ,"[from-to]"               ,oFROM_oTO  )
cmd_def(")WSID"     , Command::cmd_WSID(out, args)              ,"[[lib] wsname]"          ,oLIB_WSNAME)

cmd_def("]BOXING"   , Command::cmd_BOXING(out, arg)             ,"[OFF|2-4|7-9|i20-25|29]" ,BOXING     )
cmd_def("]COLOR"    , Command::cmd_XTERM(out, arg)              ,"[ON|OFF]"                ,oON_OFF    )
cmd_def("]DOXY"     , Command::cmd_DOXY(out, args)              ,"[path]"                  ,oPATH      )
cmd_def("]EXPECT"   , Command::cmd_EXPECT(out, arg)             ,"error_count"             ,COUNT      )
cmd_def("]HELP"     , Command::cmd_HELP(out, arg)               ,"[primitive]"             ,NO_PARAM   )
cmd_def("]KEYB"     , Cmd_KEYB::cmd_KEYB(out, args)             ,"[XMOD|XKBD|GUESS] [KEYS] [CURS] [KPAD] [FUNK]" ,oKEYB  )
cmd_def("]LIB"      , Cmd_LIB::cmd_LIB2(out, args)              ,"[lib|path] [from-to]"    ,DIR_OR_LIB )
cmd_def("]LOG"      , Command::cmd_LOG(out, arg)                ,"[facility|ON|OFF] ..."   ,LOG_NUM    )
cmd_def("]NEXTFILE" , Command::cmd_NEXTFILE(out, args)          ,"[cond ...]"              ,CONFIG     )
cmd_def("]OPTIM"    , Command::cmd_OPTIM(out, arg)              ,"[CLEAR]"                 ,PRIMITIVE  )
cmd_def("]OWNERS"   , Command::cmd_OWNERS(out)                  ,""                        ,NO_PARAM   )
cmd_def("]PUSHFILE" , Command::cmd_PUSHFILE()                   ,""                        ,NO_PARAM   )
cmd_def("]PSTAT"    , Command::cmd_PSTAT(out, arg)              ,"[CLEAR|SAVE]"            ,oCLEAR_SAVE)
cmd_def("]SIS"      , Command::cmd_SIS(out, true)               ,""                        ,NO_PARAM   )
cmd_def("]SI"       , Command::cmd_SI(out, true)                ,""                        ,NO_PARAM   )
cmd_def("]SVARS"    , Command::cmd_SVARS(out)                   ,""                        ,NO_PARAM   )
cmd_def("]SYMBOL"   , Command::cmd_SYMBOL(out, arg)             ,"symbol"                  ,SYMNAME    )
cmd_def("]USERCMD"  , Command::cmd_USERCMD(out, arg, args)      ,"[ ]ucmd APL_fun [mode]"  ,UCOMMAND   )
cmd_def("        "  , _NO_OP_                                   ,""                        ,NO_PARAM   )
cmd_def("        "  , _NO_OP_                                   ,"| ]ucmd { ... }"         ,NO_PARAM   )
cmd_def("        "  , _NO_OP_                                   ,""                        ,NO_PARAM   )
cmd_def("        "  , _NO_OP_                                   ,"| REMOVE ]ucmd"          ,NO_PARAM   )
cmd_def("        "  , _NO_OP_                                   ,""                        ,NO_PARAM   )
cmd_def("        "  , _NO_OP_                                   ,"| REMOVE-ALL"            ,NO_PARAM   )
cmd_def("        "  , _NO_OP_                                   ,""                        ,NO_PARAM   )
cmd_def("        "  , _NO_OP_                                   ,"]"                       ,NO_PARAM   )
cmd_def("]XTERM"    , Command::cmd_XTERM(out, arg)              ,"[ON|OFF]"                ,oON_OFF    )
//──────────────────────────────────────────────────────────────────────────────────────────────────────

#undef cmd_def
