Select Git revision
command.go 5.11 KiB
// Package repl implements the main event loop.
package repl
type command struct {
command string
boolFlags []string
strFlags []string
args []string
commands []*command
action func(string, *command) error
}
var commands = []*command{
{
command: "ADD",
boolFlags: []string{
"/ALL",
"/BELL",
"/BROADCAST",
"/CLUSTER",
"/EDIT",
"/EXPIRATION",
"/EXTRACT",
"/FOLDER",
"/LOCAL",
"/NODES",
"/NOINDENT",
"/PERMANENT",
"/SUBJECT",
"/SHUTDOWN",
"/SYSTEM",
"/USERNAME",
},
},
{
command: "ATTACH",
// 2 Parameters
// 2 Qualifiers
// 2 Examples
},
{
command: "BACK",
},
{
command: "BULLETIN",
},
{
command: "CHANGE",
boolFlags: []string{
"/ALL",
"/EDIT",
"/EXPIRATION",
"/GENERAL",
"/HEADER",
"/NEW",
"/NUMBER",
"/PERMANENT",
"/SHUTDOWN[=nodename]",
"/SUBJECT",
"/SYSTEM",
"/TEXT",
},
},
{
command: "COPY",
boolFlags: []string{
"/ALL",
"/MERGE",
"/ORIGINAL",
},
},
{
command: "CREATE",
boolFlags: []string{
"/BRIEF",
"/DESCRIPTION",
"/ID",
"/NODE",
"/NOTIFY",
"/OWNER",
"/PRIVATE",
"/READNEW",
"/REMOTENAME",
"/SHOWNEW",
"/SEMIPRIVATE",
"/SYSTEM",
},
},
{
command: "CURRENT",
boolFlags: []string{
"/EDIT",
},
},
{
command: "DELETE",
boolFlags: []string{
"/ALL",
"/IMMEDIATE",
"/NODES",
"/SUBJECT",
"/USERNAME",
},
},
{
command: "DIRECTORY",
boolFlags: []string{
"/DESCRIBE",
"/EXPIRATION",
"/FOLDERS",
"/MARKED",
"/NEW",
"/REPLY",
"/SEARCH",
"/SINCE",
"/START",
"/SUBJECT",
},
},
{
command: "EXIT",
},
{
command: "EXTRACT",
},
{
command: "FILE",
boolFlags: []string{
"/ALL",
"/FF",
"/HEADER",
"/NEW",
},
},
{
command: "Folders",
},
{
command: "HELP",
},
{
command: "INDEX",
boolFlags: []string{
"/MARKED",
"/NEW",
"/RESTART",
},
},
{
command: "KEYPAD",
},
{
command: "LAST",
},
{
command: "MAIL",
boolFlags: []string{
"/HEADER",
"/SUBJECT",
},
},
{
command: "MARK",
},
{
command: "MODIFY",
boolFlags: []string{
"/DESCRIPTION",
"/ID",
"/NAME",
"/OWNER",
},
},
{
command: "MOVE",
boolFlags: []string{
"/ALL",
"/MERGE",
"/ORIGINAL",
},
},
{
command: "NEXT",
},
{
command: "POST",
boolFlags: []string{
"/CC",
"/EDIT",
"/EXTRACT",
"/NOINDENT",
"/SUBJECT",
},
},
{
command: "PRINT",
boolFlags: []string{
"/ALL",
"/FORM",
"/HEADER",
"/NOTIFY",
"/QUEUE",
},
},
{
command: "READ",
boolFlags: []string{
"/EDIT",
"/MARKED",
"/NEW",
"/PAGE",
"/SINCE",
},
},
{
command: "REMOVE",
},
{
command: "REPLY",
boolFlags: []string{
"/EXTRACT",
"/NOINDENT",
},
},
{
command: "RESPOND",
boolFlags: []string{
"/CC",
"/EDIT",
"/EXTRACT",
"/LIST",
"/NOINDENT",
"/SUBJECT",
},
},
{
command: "QUIT",
},
{
command: "SEARCH",
boolFlags: []string{
"/REPLY",
"/REVERSE",
"/START",
"/SUBJECT",
},
},
{
command: "SELECT",
boolFlags: []string{
"/MARKED",
},
},
{
command: "SET",
commands: []*command{
{
command: "ACCESS",
boolFlags: []string{
//3 id
"/ALL",
"/READ",
//3 Warning
},
},
{
command: "BBOARD",
boolFlags: []string{
"/EXPIRATION",
"/SPECIAL",
"/VMSMAIL",
//3 More_information
},
},
{
command: "BRIEF",
boolFlags: []string{
"/ALL",
"/DEFAULT",
"/FOLDER",
"/PERMANENT",
},
},
{
command: "CONTINUOUS_BRIEF",
},
{
command: "DEFAULT_EXPIRE",
},
{
command: "DIGEST",
},
{
command: "DUMP",
},
{
command: "EXPIRE_LIMIT",
},
{
command: "FOLDER",
boolFlags: []string{
"/MARKED",
},
},
{
command: "GENERIC",
boolFlags: []string{
"/DAYS",
},
},
{
command: "KEYPAD",
},
{
command: "LOGIN",
},
{
command: "NODE",
boolFlags: []string{
"/FOLDER",
},
},
{
command: "NOTIFY",
boolFlags: []string{
"/ALL",
"/DEFAULT",
"/FOLDER",
"/PERMANENT",
},
},
{
command: "PAGE",
},
{
command: "PRIVILEGES",
boolFlags: []string{
"/ID",
},
},
{
command: "PROMPT_EXPIRE",
},
{
command: "READNEW",
boolFlags: []string{
"/ALL",
"/DEFAULT",
"/FOLDER",
"/PERMANENT",
},
},
{
command: "SHOWNEW",
boolFlags: []string{
"/ALL",
"/DEFAULT",
"/FOLDER",
"/PERMANENT",
},
},
{
command: "STRIP",
},
{
command: "SYSTEM",
},
},
},
{
command: "SHOW",
commands: []*command{
{
command: "FLAGS",
},
{
command: "FOLDER",
boolFlags: []string{
"/FULL",
},
},
{
command: "KEYPAD",
boolFlags: []string{
"/PRINT",
},
},
{
command: "NEW",
},
{
command: "PRIVILEGES",
},
{
command: "USER",
boolFlags: []string{
"/ALL",
"/LOGIN",
},
},
{
command: "VERSION",
},
{
command: "SPAWN",
},
{
command: "UNDELETE",
},
},
},
}