diff --git a/.gitignore b/.gitignore index 9e7bbfef63cf1e337bce111aa490f6884389cc76..8c0ef176682fc346f7a5f987e40c6f3422e4d78d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/bulletin /convert-vms-record-fmt *.bz2 *.zip diff --git a/NOTES.md b/NOTES.md index d031ba6ac5b3c319aa417fc4ee9927dfeb49f996..15e3277de66fe844ef30af6fd84b4ed5719f53dc 100644 --- a/NOTES.md +++ b/NOTES.md @@ -29,7 +29,7 @@ repl.commands? * Implement each command. * Next: folder commands - ~~CREATE~~, ~~REMOVE~~, MODIFY, ~~INDEX~~, ~~SELECT~~ - * Messages: ADD, CURRENT, DIRECTORY, BACK, CHANGE, FIRST, REMOVE, NEXT, READ + * Messages: ~~ADD~~, CURRENT, DIRECTORY, BACK, CHANGE, FIRST, REMOVE, NEXT, READ * Messages edit: CHANGE, REPLY, FORWARD * Moving messages: COPY, MOVE * Compound commands: SET and SHOW @@ -42,12 +42,18 @@ repl.commands? * Using giu, a [text-editor](https://serge-hulne.medium.com/coding-a-simple-text-editor-in-go-using-giu-quick-and-dirty-b9b97ab41e4a) (needs cgo, no) * [bubbletea](https://github.com/charmbracelet/bubbletea) seems to be the tui that's winning * Another option is tview - [simpler](https://github.com/rivo/tview). + * Handle broadcast messages - have bulletin watch a directory and + display files from it. Then have them delete the file if it's older + than 5 minutes (allow for failure) * Cleanup help output. * Remove the node/cluster/newsgroup/mailing-list related flags. + * Remove BBOARD references. + * format with `par w72j1` * Database * trigger to limit values for 'visibility'? * Add some of the early announcements from the sources - see the conversion branch - to the GENERAL folder. + * Add a pager * Add commands: * A way to add / delete ssh keys. * A way to manage files? diff --git a/accounts/accounts.go b/accounts/accounts.go index 9fee3ccd0473ee3ae59ab4a04e3f659964cf0994..b905cb16e99e4475cf70f5c6d718dbec4d578a44 100644 --- a/accounts/accounts.go +++ b/accounts/accounts.go @@ -56,12 +56,10 @@ func Open(login string) error { user.Admin = 0 fmt.Printf("Welcome new user %s\n", login) - rl, err := readline.New("please enter your name: ") + user.Name, err = GetLine("please enter your name: ") if err != nil { return err } - user.Name, err = rl.Readline() - rl.Close() err = User.Folders.AddUser(*user) if err != nil { @@ -84,3 +82,14 @@ func Open(login string) error { func (u *UserData) Close() { u.Folders.Close() } + +// GetLine gets a line. +func GetLine(prompt string) (string, error) { + rl, err := readline.New(prompt) + if err != nil { + return "", err + } + defer rl.Close() + line, err := rl.Readline() + return line, err +} diff --git a/folders/messages.go b/folders/messages.go index 3835457ca5c0bc167ff91867b63ccdd0e4356837..abb310626039466f52182ccf7d2b33720566934a 100644 --- a/folders/messages.go +++ b/folders/messages.go @@ -1,16 +1,32 @@ // Package folders are all the routines and sql for managing folders. package folders -import "time" +import ( + "fmt" + "strings" + "time" +) // CreateMessage creates a new folder. func (s *Store) CreateMessage(author, subject, message, folder string, permanent, shutdown int, expiration *time.Time) error { + if expiration == nil { + var days int + err := s.db.Get(&days, "SELECT expire FROM folders WHERE name = $1", folder) + if err != nil { + return err + } + if days <= 0 { + days = 14 + } + exp := time.Now().AddDate(0, 0, days) + expiration = &exp + } + // TODO: replace _ with rows and check. _, err := s.db.Exec( `INSERT INTO messages (id, folder, author, subject, message, permanent, shutdown, expiration) VALUES - ($1, $2, $3, $4, $5, $6, $7, $8)`, - 1, // TODO: how to set this. + ((SELECT COALESCE(MAX(id), 0) + 1 FROM messages WHERE folder = $1), $1, $2, $3, $4, $5, $6, $7)`, folder, author, subject, @@ -22,3 +38,44 @@ func (s *Store) CreateMessage(author, subject, message, folder string, permanent // TODO: process this error a bit more to give a better error message. return err } + +// Message contains a message +type Message struct { + ID int `db:"id"` + Folder string `db:"folder"` + Author string `db:"author"` + Subject string `db:"subject"` + Message string `db:"message"` + Expires time.Time `db:"expiration"` + CreateAt time.Time `db:"create_at"` + UpdateAt time.Time `db:"update_at"` +} + +// String renders a message. +func (m *Message) String() string { + buf := &strings.Builder{} + // TODO: Show if an edit has happened. + fmt.Fprintf(buf, "From: \"%s\" %s\n", m.Author, m.CreateAt.Format("02-JAN-2006 15:04:05")) + fmt.Fprintf(buf, "To: %s\n", m.Folder) + fmt.Fprintf(buf, "Subj: %s\n\n", m.Subject) + fmt.Fprintf(buf, "%s\n", m.Message) + + return buf.String() +} + +// ReadMessage reads a message for a user. +func (s *Store) ReadMessage(login, folder string, msgid int) (*Message, error) { + msg := &Message{} + err := s.db.Get(msg, + `SELECT id, folder, author, subject, message, expiration, create_at, update_at + FROM messages WHERE folder = $1, id = $2`, folder, msgid) + if err != nil { + return nil, err + } + // TODO: replace _ with rows and check. + _, err = s.db.Exec( + "INSERT INTO read (login, folder, msgid) VALUES ($1, $2, $3)", + login, folder, msgid) + + return msg, err +} diff --git a/folders/sql/1_create_table.up.sql b/folders/sql/1_create_table.up.sql index 208bc9755639b0225d48440c5b9c8a14011df76a..86631a20bf01f5baff868703dd5bf6badd3c1d9c 100644 --- a/folders/sql/1_create_table.up.sql +++ b/folders/sql/1_create_table.up.sql @@ -117,3 +117,14 @@ CREATE TABLE messages ( CREATE INDEX messages_idx_shutdown ON messages(shutdown); CREATE INDEX messages_idx_expiration ON messages(expiration); +CREATE TABLE read ( + login VARCHAR(25) REFERENCES users(login) ON DELETE CASCADE ON UPDATE CASCADE, + folder VARCHAR(25) REFERENCES folders(name) ON DELETE CASCADE ON UPDATE CASCADE, + msgid INT, + PRIMARY KEY (folder, login, msgid), + CONSTRAINT FK_id_folder + FOREIGN KEY (msgid, folder) + REFERENCES messages(id, folder) + ON DELETE CASCADE + ON UPDATE CASCADE +) WITHOUT ROWID; diff --git a/go.mod b/go.mod index c6997802db3e8ff5106caf0584601998d708e186..406d51c905576656a91fcd4844fb61d2a00a1d78 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( require ( github.com/dustin/go-humanize v1.0.1 // indirect + github.com/earthboundkid/versioninfo/v2 v2.24.1 // indirect github.com/gdamore/encoding v1.0.0 // indirect github.com/golang-migrate/migrate v3.5.4+incompatible // indirect github.com/google/uuid v1.6.0 // indirect diff --git a/go.sum b/go.sum index d391d14b4ad7e07a99bf01c76dcb33f26c6aafcf..ec0708642f0bb9ccde75b2211857926955fbfb65 100644 --- a/go.sum +++ b/go.sum @@ -9,6 +9,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/earthboundkid/versioninfo/v2 v2.24.1 h1:SJTMHaoUx3GzjjnUO1QzP3ZXK6Ee/nbWyCm58eY3oUg= +github.com/earthboundkid/versioninfo/v2 v2.24.1/go.mod h1:VcWEooDEuyUJnMfbdTh0uFN4cfEIg+kHMuWB2CDCLjw= github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/tcell/v2 v2.7.1 h1:TiCcmpWHiAU7F0rA2I3S2Y4mmLmO9KHxJ7E1QhYzQbc= diff --git a/repl/command.go b/repl/command.go index 61f9a5adac395810448b70ab1f8176f31421708c..f597551573cb8caa247c6f9c24ab3999bd835bf0 100644 --- a/repl/command.go +++ b/repl/command.go @@ -5,9 +5,9 @@ import "git.lyda.ie/kevin/bulletin/dclish" var commands = dclish.Commands{ "ADD": { - Description: `Adds a message to the specified folder. A file can be specified which -contains the message. Otherwise, BULLETIN will prompt for the text. -BULLETIN will ask for an expiration date and a header to contain the + Description: `Adds a message to the specified folder. A file can be specified which +contains the message. Otherwise, BULLETIN will prompt for the text. +BULLETIN will ask for an expiration date and a header to contain the topic of the message. Format: @@ -16,240 +16,247 @@ topic of the message. Action: ActionAdd, Flags: dclish.Flags{ "/ALL": { - Description: `This option is restricted to privileged users. It is used in conjunction -with the /BROADCAST qualifier. If specified, all terminals are sent the -message. Otherwise, only users are sent the message.`, + Description: ` This option is restricted to privileged users. It is used in + conjunction with the /BROADCAST qualifier. If specified, all terminals + are sent the message. Otherwise, only users are sent the message.`, }, "/BELL": { - Description: `This option is restricted to privileged users. It is used in conjunction -with the /BROADCAST qualifier. If specified, the bell is rung on the -terminals when the message is broadcasted.`, + Description: ` This option is restricted to privileged users. It is used in + conjunction with the /BROADCAST qualifier. If specified, the bell is + rung on the terminals when the message is broadcasted.`, }, "/BROADCAST": { - Description: `This option is restricted to privileged users and SYSTEM folders. If -specified, a message is both stored and broadcasted to all users logged -in at the time. If the folder is remote, a message will be broadcast on -all nodes which are connected to that folder, unless /LOCAL is specified. -A node which does not have BULLCP running cannot have a message -broadcasted to it, (even though it is able to create a remote folder). + Description: ` This option is restricted to privileged users and SYSTEM folders. If + specified, a message is both stored and broadcasted to all users + logged in at the time. If the folder is remote, a message will be + broadcast on all nodes which are connected to that folder, unless + /LOCAL is specified. A node which does not have BULLCP running cannot + have a message broadcasted to it, (even though it is able to create a + remote folder). -See also /ALL and /BELL.`, + See also /ALL and /BELL.`, }, "/EDIT": { Description: `/[NO]EDIT -Determines whether or not the editor is invoked to edit the message -you are adding. /EDIT is the default if you have added /EDIT to your -BULLETIN command line.`, + + Determines whether or not the editor is invoked to edit the message + you are adding. /EDIT is the default.`, + Default: "true", }, "/EXPIRATION": { Description: `/EXPIRATION=time -Specifies the time at which the message is to expire. Either absolute -time: [dd-mmm-yyyy] hh:mm:ss, or delta time: dddd [hh:mm:ss] can be -used.`, + Specifies the time at which the message is to expire. Either absolute + time: dd-mmm-yyyy, or delta time: dddd can be used.`, OptArg: true, }, "/EXTRACT": { - Description: `Specifies that the text of the previously read message should be included -at the beginning of the new message. The previous message must be in the -same folder. This qualifier is valid only when used with /EDIT. The -text is indented with > at the beginning of each line. This can be -suppressed with /NOINDENT.`, + Description: ` Specifies that the text of the previously read message should be + included at the beginning of the new message. The previous message + must be in the same folder. This qualifier is valid only when used + with /EDIT. The text is indented with > at the beginning of each line. + This can be suppressed with /NOINDENT.`, }, "/FOLDER": { Description: `/FOLDER=(foldername,[...]) -Specifies the foldername into which the message is to be added. Does -not change the current selected folder. + Specifies the foldername into which the message is to be added. Does + not change the current selected folder. -You can specify logical names which translate to one or more folder -names. I.e. $ DEFINE ALL_FOLDERS "VAX1,VAX2,VAX3", and then specify -ALL_FOLDERS after /FOLDER=. Note that the quotation marks are required.`, + You can specify logical names which translate to one or more folder + names. I.e. $ DEFINE ALL_FOLDERS "VAX1,VAX2,VAX3", and then specify + ALL_FOLDERS after /FOLDER=. Note that the quotation marks are required.`, OptArg: true, }, "/INDENT": { - Description: `See /EXTRACT for information on this qualifier. + Description: ` See /EXTRACT for information on this qualifier. -Defaults to set - use /NOINDENT to suppress.`, + Defaults to set - use /NOINDENT to suppress.`, Default: "true", }, "/SIGNATURE": { - Description: `Specifies to automatically appended signature, if one exists. -Signatures are appended for postings to mailing lists and to responds. -See the help topic POST Signature_file for signature information. + Description: ` Specifies to automatically appended signature, if one exists. + Signatures are appended for postings to mailing lists and to responds. + See the help topic POST Signature_file for signature information. -Defaults to set - use /NOSIGNATURE to suppress.`, + Defaults to set - use /NOSIGNATURE to suppress.`, Default: "true", }, "/PERMANENT": { - Description: `If specified, message will be a permanent message and will never expire. -If an expiration limit is set, then permament is not allowed unless -user has privileges.`, + Description: ` If specified, message will be a permanent message and will never + expire. If an expiration limit is set, then permament is not allowed + unless user has privileges.`, }, "/SUBJECT": { Description: `/SUBJECT=description -Specifies the subject of the message to be added.`, + Specifies the subject of the message to be added.`, OptArg: true, }, "/SHUTDOWN": { - Description: `/SHUTDOWN -This option is restricted to privileged users. If specified, message -will be automatically deleted after a computer shutdown has occurred. -This option is restricted to SYSTEM folders. - -If the bulletin files are shared between cluster nodes, the message -will be deleted after the node on which the message was submitted from -is rebooted. If you wish the message to be deleted after a different -node reboots, you have the option of specifying that node name. - -NOTE: If the folder is a remote folder, the message will be deleted -after the remote node reboots, not the node from which the message was -added. The nodename cannot be specified with a remote folder.`, + Description: ` This option is restricted to privileged users. If specified, message + will be automatically deleted after a computer shutdown has occurred. + This option is restricted to SYSTEM folders. + + If the bulletin files are shared between cluster nodes, the message + will be deleted after the node on which the message was submitted from + is rebooted. If you wish the message to be deleted after a different + node reboots, you have the option of specifying that node name. + + NOTE: If the folder is a remote folder, the message will be deleted + after the remote node reboots, not the node from which the message was + added. The nodename cannot be specified with a remote folder.`, OptArg: true, }, "/SYSTEM": { - Description: `This option is restricted to privileged users. If specified, message -is both saved in the folder and displayed in full as a system message -when a user logs in. System messages should be as brief as possible to -avoid the possibility that system messages could scroll off the screen. -This option is restricted to SYSTEM folders.`, + Description: ` This option is restricted to privileged users. If specified, message + is both saved in the folder and displayed in full as a system message + when a user logs in. System messages should be as brief as possible to + avoid the possibility that system messages could scroll off the + screen. This option is restricted to SYSTEM folders.`, }, }, }, "BACK": { Description: `Displays the message preceding the current message.`, + Action: ActionBack, Flags: dclish.Flags{ "/EDIT": { - Description: `Specifies that the editor is to be used to read the message. This is -useful for scanning a long message.`, + Description: `/EDIT + + Specifies that the editor is to be used to read the message. This is + useful for scanning a long message.`, }, "/HEADER": { Description: `/[NO]HEADER -Specifies that if a message header exists, the header will be shown. -If /HEADER or /NOHEADER is specified, the setting will apply for all -further reads in the selected folder. The default is /HEADER.`, + Specifies that if a message header exists, the header will be shown. + If /HEADER or /NOHEADER is specified, the setting will apply for all + further reads in the selected folder. The default is /HEADER.`, }, }, }, "CHANGE": { - Description: `Replaces or modifies existing stored message. This is for changing part -or all of a message without causing users who have already seen the -message to be notified of it a second time. You can select qualifiers so -that either the message text, expiration date, or the header are to be -changed. If no qualifier is added, the default is that all these parameters -are to be changed. If the text of the message is to be changed, a file can -be specified which contains the text. If the editor is used for changing -the text, the old message text will be extracted. This can be suppressed -by the qualifier /NEW. - - Format: - CHANGE [file-name]`, + Description: `Replaces or modifies existing stored message. This is for changing part +or all of a message without causing users who have already seen the +message to be notified of it a second time. You can select qualifiers so +that either the message text, expiration date, or the header are to be +changed. If no qualifier is added, the default is that all these +parameters are to be changed. If the text of the message is to be +changed, a file can be specified which contains the text. If the editor +is used for changing the text, the old message text will be extracted. +This can be suppressed by the qualifier /NEW. + + Format: + CHANGE [file-name]`, MaxArgs: 1, + Action: ActionChange, Flags: dclish.Flags{ "/ALL": { - Description: `Makes the changes to all the messages in the folder. Only the expiration -date and message headers can be changed if this qualifier is specified.`, + Description: ` Makes the changes to all the messages in the folder. Only the + expiration date and message headers can be changed if this qualifier + is specified.`, }, "/EDIT": { Description: `/[NO]EDIT -Determines whether or not the editor is invoked to edit the message -you are replacing. The old message text is read into the editor unless -a file-name or /NEW is specified. /EDIT is the default if you have -added /EDIT to your BULLETIN command line.`, + + Determines whether or not the editor is invoked to edit the message + you are replacing. The old message text is read into the editor unless + a file-name or /NEW is specified. /EDIT is the default if you have + added /EDIT to your BULLETIN command line.`, }, "/EXPIRATION": { Description: `/EXPIRATION[=time] -Specifies the time at which the message is to expire. Either absolute -time: [dd-mmm-yyyy] hh:mm:ss, or delta time: dddd [hh:mm:ss] can be -used. If no time is specified, you will be prompted for the time.`, + Specifies the time at which the message is to expire. Either absolute + time: dd-mmm-yyyy, or delta time: dddd can be used. If no time is + specified, you will be prompted for the time.`, OptArg: true, }, "/GENERAL": { - Description: `Specifies that the message is to be converted from a SYSTEM message to -a GENERAL message. This only applies to the GENERAL folder.`, + Description: ` Specifies that the message is to be converted from a SYSTEM message to + a GENERAL message. This only applies to the GENERAL folder.`, }, "/HEADER": { - Description: `Specifies that the message header is to be replaced. You will be -prompted for the new message description.`, + Description: ` Specifies that the message header is to be replaced. You will be + prompted for the new message description.`, }, "/NEW": { - Description: `If the editor is to be used for replacing the text of the message, -NEW specifies not to read in the old message text, and that a totally -new text is to be read in.`, + Description: ` If the editor is to be used for replacing the text of the message, NEW + specifies not to read in the old message text, and that a totally new + text is to be read in.`, }, "/NUMBER": { Description: `/NUMBER=message_number[-message_number1] -Specifies the message or messages to be replaced. If this qualifier is -omitted, the message that is presently being read will be replaced. -A range of messages can be specified, i.e. /NUMBER=1-5. Only the expiration -date and message headers can be changed if a range is specified. + Specifies the message or messages to be replaced. If this qualifier is + omitted, the message that is presently being read will be replaced. A + range of messages can be specified, i.e. /NUMBER=1-5. Only the + expiration date and message headers can be changed if a range is + specified. -The key words CURRENT and LAST can also be specified in the range, -in place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc.`, + The key words CURRENT and LAST can also be specified in the range in, + place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc.`, OptArg: true, }, "/PERMANENT": { - Description: `Specifies that the message is to be made permanent.`, + Description: ` Specifies that the message is to be made permanent.`, }, "/SHUTDOWN": { - Description: `Specifies that the message is to expire after the next computer -shutdown. This option is restricted to SYSTEM folders.`, + Description: ` Specifies that the message is to expire after the next computer + shutdown. This option is restricted to SYSTEM folders.`, }, "/SUBJECT": { Description: `/SUBJECT=description -Specifies the subject of the message to be added.`, + Specifies the subject of the message to be added.`, OptArg: true, }, "/SYSTEM": { - Description: `Specifies that the message is to be made a SYSTEM message. This is a -privileged command and is restricted to SYSTEM folders.`, + Description: ` Specifies that the message is to be made a SYSTEM message. This is a + privileged command and is restricted to SYSTEM folders.`, }, "/TEXT": { - Description: `Specifies that the message text is to be replaced.`, + Description: ` Specifies that the message text is to be replaced.`, }, }, }, "COPY": { - Description: `Copies a message to another folder without deleting it from the -current folder. + Description: `Copies a message to another folder without deleting it from the current +folder. Format: - COPY folder-name [message_number][-message_number1] -The folder-name is the name of the folder to which the message is to be -copied to. Optionally, a range of messages which are to be copied can be +The folder-name is the name of the folder to which the message is to be +copied to. Optionally, a range of messages which are to be copied can be specified following the folder name, i.e. COPY NEWFOLDER 2-5. -The key words CURRENT and LAST can also be specified in the range, -in place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc.`, +The key words CURRENT and LAST can also be specified in the range in, +place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc.`, MinArgs: 1, MaxArgs: 2, Flags: dclish.Flags{ "/ALL": { - Description: `Specifies to copy all the messages in the old folder.`, + Description: ` Specifies to copy all the messages in the old folder.`, }, "/HEADER": { Description: `/[NO]HEADER -Valid only if destination folder is a news group. Specifies that header -of message is to be included with the text when the text is copied. -The default is /NOHEADER.`, + Valid only if destination folder is a news group. Specifies that + header of message is to be included with the text when the text is + copied. The default is /NOHEADER.`, }, "/MERGE": { - Description: `Specifies that the original date and time of the copied messages are -saved and that the messages are placed in correct chronological order -in the new folder. This operation is lengthy if the new folder is large.`, + Description: ` Specifies that the original date and time of the copied messages are + saved and that the messages are placed in correct chronological order + in the new folder. This operation is lengthy if the new folder is + large.`, }, "/ORIGINAL": { - Description: `Specifies that the owner of the copied message will be the original owner -of the message. The default is that the copied message will be owned by -the person copying the message.`, + Description: ` Specifies that the owner of the copied message will be the original + owner of the message. The default is that the copied message will be + owned by the person copying the message.`, }, }, }, @@ -277,85 +284,88 @@ BULLCOM.CLD.`, MaxArgs: 1, Flags: dclish.Flags{ "/ALWAYS": { - Description: `Specifies that the folder has the ALWAYS attribute. This causes -messages in the folder to be displayed differently when logging in. -SYSTEM messages will be displayed every time a user logs in, rather than -just once. Non-SYSTEM message will also be displayed every time (in -whatever mode is selected, i.e. BRIEF, SHOWNEW, or READNEW) until the -user actually reads that message (or a later one). This feature is -meant for messages which are very important, and thus you want to make -sure they are read.`, + Description: ` Specifies that the folder has the ALWAYS attribute. This causes + messages in the folder to be displayed differently when logging in. + SYSTEM messages will be displayed every time a user logs in, rather than + just once. Non-SYSTEM message will also be displayed every time (in + whatever mode is selected, i.e. BRIEF, SHOWNEW, or READNEW) until the + user actually reads that message (or a later one). This feature is + meant for messages which are very important, and thus you want to make + sure they are read.`, }, "/BRIEF": { - Description: `Specifies that all users automatically have BRIEF set for this folder. -Only a privileged user can use this qualifier. (See HELP SET BRIEF for -more information.)`, + Description: ` Specifies that all users automatically have BRIEF set for this folder. + Only a privileged user can use this qualifier. (See HELP SET BRIEF for + more information.)`, }, "/DESCRIPTION": { Description: `/DESCRIPTION=description -Specifies the description of the folder, which is displayed using the -SHOW FOLDER command. If omitted, you are prompted for a description.`, + Specifies the description of the folder, which is displayed using the + SHOW FOLDER command. If omitted, you are prompted for a description.`, OptArg: true, }, "/EXPIRE": { Description: `/EXPIRE=days -Sets the default number of days for messages to expire. + Sets the default number of days for messages to expire. -Default value is 14.`, + Default value is 14.`, OptArg: true, Default: "14", }, "/ID": { - Description: `Designates that the name specified as the owner name is a rights -identifier. The creator's process must have the identifier presently -assigned to it. Any process which has that identifier assigned to it -will be able to control the folder as if it were the folder's owner. -This is used to allow more than one use to control a folder.`, + Description: ` Designates that the name specified as the owner name is a rights + identifier. The creator's process must have the identifier presently + assigned to it. Any process which has that identifier assigned to it + will be able to control the folder as if it were the folder's owner. + This is used to allow more than one use to control a folder.`, OptArg: true, }, "/NOTIFY": { - Description: `Specifies that all users automatically have NOTIFY set for this folder. -Only a privileged user can use this qualifier. (See HELP SET NOTIFY for -more information.)`, + Description: ` Specifies that all users automatically have NOTIFY set for this + folder. Only a privileged user can use this qualifier. (See HELP SET + NOTIFY for more information.)`, }, "/OWNER": { Description: `/OWNER=username -Specifies the owner of the folder. This is a privileged command. -See also /ID.`, + + Specifies the owner of the folder. This is a privileged command. See + also /ID.`, OptArg: true, }, "/PRIVATE": { - Description: `Specifies that the folder can only be accessed by users who have been -granted access via the SET ACCESS command. Note: This option uses ACLs -and users who are granted access must be entered into the Rights Data Base. -If the RDB does not exist on your system, a privileged user will have to -create it. If a user is not in the RDB, this program will automatically -enter the user into it (unless this feature was disabled during the -compilation of this program). NOTE: See HELP SET ACCESS for more info.`, + Description: ` Specifies that the folder can only be accessed by users who have been + granted access via the SET ACCESS command. Note: This option uses ACLs + and users who are granted access must be entered into the Rights Data + Base. If the RDB does not exist on your system, a privileged user will + have to create it. If a user is not in the RDB, this program will + automatically enter the user into it (unless this feature was disabled + during the compilation of this program). NOTE: See HELP SET ACCESS for + more info.`, }, "/READNEW": { - Description: `Specifies that all users automatically have READNEW set for this folder. -Only a privileged user can use this qualifier. (See HELP SET READNEW for -more information.)`, + Description: ` Specifies that all users automatically have READNEW set for this + folder. Only a privileged user can use this qualifier. (See HELP SET + READNEW for more information.)`, }, "/SHOWNEW": { - Description: `Specifies that all users automatically have SHOWNEW set for this folder. -Only a privileged user can use this qualifier. (See HELP SET SHOWNEW for -more information.)`, + Description: ` Specifies that all users automatically have SHOWNEW set for this + folder. Only a privileged user can use this qualifier. (See HELP SET + SHOWNEW for more information.)`, }, "/SEMIPRIVATE": { - Description: `Similar to /PRIVATE, except that the folder is restricted only with -respect to adding or modifying messages. All users can read the folder.`, + Description: ` Similar to /PRIVATE, except that the folder is restricted only with + respect to adding or modifying messages. All users can read the + folder.`, }, "/SYSTEM": { - Description: `Specifies that the folder is a SYSTEM folder. A SYSTEM folder is -allowed to have SYSTEM and SHUTDOWN messages added to it. By default, -the GENERAL folder is a SYSTEM folder. This is a privileged command. + Description: ` Specifies that the folder is a SYSTEM folder. A SYSTEM folder is + allowed to have SYSTEM and SHUTDOWN messages added to it. By default, + the GENERAL folder is a SYSTEM folder. This is a privileged command. -If this is a remote folder, /SYSTEM cannot be specified unless the -folder at the other node is also a SYSTEM folder.`, + If this is a remote folder, /SYSTEM cannot be specified unless the + folder at the other node is also a SYSTEM folder.`, }, }, }, @@ -365,59 +375,59 @@ you are reading a long message and want to display the first part of the message again, you can enter the CURRENT command. Format: - CURRENT`, + Action: ActionCurrent, Flags: dclish.Flags{ "/EDIT": { - Description: `Specifies that the editor is to be used to read the message. This is -useful for scanning a long message.`, + Description: ` Specifies that the editor is to be used to read the message. This is + useful for scanning a long message.`, }, "/HEADER": { Description: `/[NO]HEADER -Specifies that if a message header exists, the header will be shown. -If /HEADER or /NOHEADER is specified, the setting will apply for all -further reads in the selected folder. The default is /HEADER.`, + Specifies that if a message header exists, the header will be shown. + If /HEADER or /NOHEADER is specified, the setting will apply for all + further reads in the selected folder. The default is /HEADER.`, }, }, }, "DELETE": { - Description: `Deletes the specified message. If no message is specified, the current -message is deleted. Only the original owner or a privileged user can -delete a message. Note that the message is not deleted immediately, but -its expiration is set 15 minutes in the future. This is to allow a user -to recover the message using the UNDELETE command. If you want the + Description: `Deletes the specified message. If no message is specified, the current +message is deleted. Only the original owner or a privileged user can +delete a message. Note that the message is not deleted immediately, but +its expiration is set 15 minutes in the future. This is to allow a user +to recover the message using the UNDELETE command. If you want the message deleted immediately, use the /IMMEDIATE qualifier. Format: DELETE [message_number][-message_number1] -The message's relative number is found by the DIRECTORY command. It is -possible to delete a range of messages by specifying two numbers -separated by a dash, i.e. DELETE 1-5. However, a range cannot be +The message's relative number is found by the DIRECTORY command. It is +possible to delete a range of messages by specifying two numbers +separated by a dash, i.e. DELETE 1-5. However, a range cannot be specified if the folder is remote. -The key words CURRENT and LAST can also be specified in the range, -in place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc.`, +The key words CURRENT and LAST can also be specified in the range in, +place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc.`, MaxArgs: 1, Flags: dclish.Flags{ "/ALL": { - Description: `Specifies to delete all the messages in the folder. Note: This will -not work for remote folders. Only one message can be deleted from a -remote folder at a time.`, + Description: ` Specifies to delete all the messages in the folder. Note: This will + not work for remote folders. Only one message can be deleted from a + remote folder at a time.`, }, "/IMMEDIATE": { - Description: `Specifies that the message is to be deleted immediately.`, + Description: ` Specifies that the message is to be deleted immediately.`, }, "/SUBJECT": { Description: `/SUBJECT=subject -Specifies the subject of the bulletin to be deleted at a remote DECNET -node. The DECNET node must be specified with the /NODE qualifier. -The specified subject need not be the exact subject of the message. -It can be a substring of the subject. This is in case you have forgotten -the exact subject that was specified. Case is not critical either. -You will be notified if the deletion was successful.`, + Specifies the subject of the bulletin to be deleted at a remote DECNET + node. The DECNET node must be specified with the /NODE qualifier. The + specified subject need not be the exact subject of the message. It can + be a substring of the subject. This is in case you have forgotten the + exact subject that was specified. Case is not critical either. You + will be notified if the deletion was successful.`, OptArg: true, }, }, @@ -427,7 +437,6 @@ You will be notified if the deletion was successful.`, date, and subject of each message is displayed. Format: - DIRECTORY [folder] If a folder is specified, that folder is selected before the directory @@ -439,97 +448,99 @@ that message.`, Action: ActionDirectory, Flags: dclish.Flags{ "/ALL": { - Description: `Lists all messages. Used if the qualifiers /MARKED, /UNMARKED, /SEEN, -or /UNSEEN were previously specified.`, + Description: ` Lists all messages. Used if the qualifiers /MARKED, /UNMARKED, /SEEN, + or /UNSEEN were previously specified.`, }, "/DESCRIBE ": { - Description: `Valid when used with /FOLDERS. Specifies to include description of -folder.`, + Description: ` Valid when used with /FOLDERS. Specifies to include description of + folder.`, }, "/EXPIRATION": { - Description: `Shows the message's expiration date rather than the creation date.`, + Description: ` Shows the message's expiration date rather than the creation date.`, }, "/END": { Description: `/END=message_number -Indicates the last message number you want to display.`, + Indicates the last message number you want to display.`, OptArg: true, }, "/FOLDERS": { - Description: `Lists the available message folders. Shows last message date and number -of messages in folder. An asterisk (*) next to foldername indicates -that there are unread messages in that folder.`, + Description: ` Lists the available message folders. Shows last message date and + number of messages in folder. An asterisk (*) next to foldername + indicates that there are unread messages in that folder.`, }, "/MARKED": { - Description: `Lists messages that have been marked (indicated by an asterisk). -This is equivalent to selecting the folder with /MARKED, i.e. only -marked messages will be shown and be able to be read. To see all -messages, use either /ALL, or reselect the folder.`, + Description: ` Lists messages that have been marked (indicated by an asterisk). This + is equivalent to selecting the folder with /MARKED, i.e. only marked + messages will be shown and be able to be read. To see all messages, + use either /ALL, or reselect the folder.`, }, "/UNMARKED": { - Description: `Lists messages that have not been marked (marked messages are indicated -by an asterisk). Using /UNMARKED is equivalent to selecting the folder -with /UNMARKED, i.e. only unmarked messages will be shown and be able -to be read. To see all messages, use either /ALL, or reselect the -folder.`, + Description: ` Lists messages that have not been marked (marked messages are + indicated by an asterisk). Using /UNMARKED is equivalent to selecting + the folder with /UNMARKED, i.e. only unmarked messages will be shown + and be able to be read. To see all messages, use either /ALL, or + reselect the folder.`, }, "/SEEN": { - Description: `Lists messages that have been seen (indicated by a greater than sign). -Using /SEEN is equivalent to selecting the folder with /SEEN, i.e. only -seen messages will be shown and be able to be read. To see all -messages, use either /ALL, or reselect the folder.`, + Description: ` Lists messages that have been seen (indicated by a greater than sign). + Using /SEEN is equivalent to selecting the folder with /SEEN, i.e. + only seen messages will be shown and be able to be read. To see all + messages, use either /ALL, or reselect the folder.`, }, "/UNSEEN": { - Description: `Lists messages that have not been seen (seen message are indicated by a -greater than sign). Using /UNSEEN is equivalent to selecting the folder -with /UNSEEN, i.e. only unseen messages will be shown and be able to be -read. To see all messages, use either /ALL, or reselect the folder.`, + Description: ` Lists messages that have not been seen (seen message are indicated by + a greater than sign). Using /UNSEEN is equivalent to selecting the + folder with /UNSEEN, i.e. only unseen messages will be shown and be + able to be read. To see all messages, use either /ALL, or reselect the + folder.`, }, "/NEW": { - Description: `Specifies to start the listing of messages with the first unread -message.`, + Description: ` Specifies to start the listing of messages with the first unread + message.`, }, "/PRINT": { - Description: `Specifies that the text of the messages which are found by the -DIRECTORY command are to be printed. All qualifiers which are valid -for the PRINT command are valid in conjunction with /PRINT. The list -of messages to be printed will be displayed on the terminal (in -nopaging format).`, + Description: ` Specifies that the text of the messages which are found by the + DIRECTORY command are to be printed. All qualifiers which are valid + for the PRINT command are valid in conjunction with /PRINT. The list + of messages to be printed will be displayed on the terminal (in + nopaging format).`, }, "/REPLY": { - Description: `Specifies that only messages which are replies to the current message -are to be displayed. This cannot be used in conjunction with /MARKED.`, + Description: ` Specifies that only messages which are replies to the current message + are to be displayed. This cannot be used in conjunction with + /MARKED.`, }, "/SEARCH": { Description: `/SEARCH=[string] -Specifies that only messages which contain the specified string are -to be displayed. This cannot be used in conjunction with /MARKED. -If no string is specified, the previously specified string is used.`, + Specifies that only messages which contain the specified string are to + be displayed. This cannot be used in conjunction with /MARKED. If no + string is specified, the previously specified string is used.`, OptArg: true, }, "/SINCE": { Description: `/SINCE=date -Displays a listing of all the messages created on or after the -specified date. If no date is specified, the default is TODAY.`, + Displays a listing of all the messages created on or after the + specified date. If no date is specified, the default is TODAY.`, OptArg: true, }, "/START": { Description: `/START=message_number -Indicates the first message number you want to display. For example, -to display all the messages beginning with number three, enter the -command line DIRECTORY/START=3. Not valid with /FOLDER.`, + Indicates the first message number you want to display. For example, + to display all the messages beginning with number three, enter the + command line DIRECTORY/START=3. Not valid with /FOLDER.`, OptArg: true, }, "/SUBJECT": { Description: `/SUBJECT=[string] -Specifies that only messages which contain the specified string in it's -subject header are to be displayed. This cannot be used in conjunction -with /MARKED. If no string is specified, the previously specified string -is used.`, + Specifies that only messages which contain the specified string in + it's subject header are to be displayed. This cannot be used in + conjunction with /MARKED. If no string is specified, the previously + specified string is used.`, OptArg: true, }, }, @@ -542,187 +553,166 @@ is used.`, Description: `Synonym for FILE command.`, }, "FILE": { - Description: `Copies the current message to the named file. The file-name parameter -is required. If the file exists, the message is appended to the file, + Description: `Copies the current message to the named file. The file-name parameter is +required. If the file exists, the message is appended to the file, unless the /NEW qualifier is specified. Format: FILE filename [message_number][-message_number1],[...] -A range of messages to be copied can optionally be specified, i.e. -FILE 2-5. +A range of messages to be copied can optionally be specified, i.e FILE. +2-5 . -The key words CURRENT and LAST can also be specified in the range, -in place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc.`, +The key words CURRENT and LAST can also be specified in the range in, +place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc.`, MinArgs: 1, MaxArgs: 2, Flags: dclish.Flags{ "/ALL": { - Description: `Copies all the messages in the current folder.`, + Description: ` Copies all the messages in the current folder.`, }, "/FF": { - Description: `Specifies that a form feed is placed between messages in the file.`, + Description: ` Specifies that a form feed is placed between messages in the file.`, }, "/HEADER": { Description: `/[NO]HEADER -Controls whether a header containing the owner, subject, and date of the -message is written in the file. The default is to write the header.`, + Controls whether a header containing the owner, subject, and date of + the message is written in the file. The default is to write the + header.`, }, "/NEW": { - Description: `Specifies that a new file is to be created. Otherwise, if the specified -file exists, the file would be appended to that file.`, + Description: ` Specifies that a new file is to be created. Otherwise, if the + specified file exists, the file would be appended to that file.`, }, }, }, "FIRST": { Description: `Specifies that the first message in the folder is to be read.`, + Action: ActionFirst, }, "FORWARD": { Description: `Synonym for MAIL command.`, + Action: ActionForward, }, "HELP": { Description: `To obtain help on any topic, type: - HELP topic - -Type "HELP Topics" to get a list of topics.`, + HELP topic`, MaxArgs: 1, Action: ActionHelp, }, "INDEX": { - Description: `Gives directory listing of all folders in alphabetical order. If the -INDEX command is re-entered while the listing is in progress, the listing -will skip to the next folder. This is useful for skipping a particular -folder. It also can be used to continue the listing from where one left -off after one has read a message. + Description: `Gives directory listing of all folders in alphabetical order. If the +INDEX command is re-entered while the listing is in progress, the +listing will skip to the next folder. This is useful for skipping a +particular folder. It also can be used to continue the listing from +where one left off after one has read a message. Format: - INDEX`, + INDEX`, Action: ActionIndex, Flags: dclish.Flags{ "/MARKED": { - Description: `Lists messages that have been marked (marked messages are indicated by -an asterisk). This is equivalent to selecting the folder with /MARKED, -i.e. only marked messages will be shown and be able to be read.`, + Description: ` Lists messages that have been marked (marked messages are indicated by + an asterisk). This is equivalent to selecting the folder with /MARKED, + i.e. only marked messages will be shown and be able to be read.`, }, "/UNMARKED": { - Description: `Lists messages that have not been marked (marked messages are indicated -by an asterisk). Using /UNMARKED is equivalent to selecting the folder -with /UNMARKED, i.e. only unmarked messages will be shown and be able -to be read.`, + Description: ` Lists messages that have not been marked (marked messages are + indicated by an asterisk). Using /UNMARKED is equivalent to selecting + the folder with /UNMARKED, i.e. only unmarked messages will be shown + and be able to be read.`, }, "/SEEN": { - Description: `Lists messages that have been seen (indicated by a greater than sign). -Using /SEEN is equivalent to selecting the folder with /SEEN, i.e. only -seen messages will be shown and be able to be read.`, + Description: ` Lists messages that have been seen (indicated by a greater than sign). + Using /SEEN is equivalent to selecting the folder with /SEEN, i.e. + only seen messages will be shown and be able to be read.`, }, "/UNSEEN": { - Description: `Lists messages that have not been seen (seen message are indicated by a -greater than sign). Using /UNSEEN is equivalent to selecting the folder -with /UNSEEN, i.e. only unseen messages will be shown and be able to be -read.`, + Description: ` Lists messages that have not been seen (seen message are indicated by a + greater than sign). Using /UNSEEN is equivalent to selecting the folder + with /UNSEEN, i.e. only unseen messages will be shown and be able to be + read.`, }, "/NEW": { - Description: `Specifies to start the listing of each folder with the first unread message. -Otherwise, the listing will start with the first message in the folder. -If the INDEX command is re-entered for continuing the listing, /NEW must -be respecified.`, + Description: ` Specifies to start the listing of each folder with the first unread + message. Otherwise, the listing will start with the first message in + the folder. If the INDEX command is re-entered for continuing the + listing, /NEW must be respecified.`, }, "/RESTART": { - Description: `If specified, causes the listing to be reinitialized and start from the -first folder.`, + Description: ` If specified, causes the listing to be reinitialized and start from + the first folder.`, }, "/SUBSCRIBE": { - Description: `If specified, lists only those news folders which have been subscribed to.`, + Description: ` If specified, lists only those news folders which have been + subscribed to.`, }, }, }, - "KEYPAD": { - Description: `+--------+--------+--------+--------+ - | PF1 | PF2 | PF3 | PF4 | - | GOLD | HELP | EXTRACT|SHOW KEY| - | |ST NOKEY| FILE |SH KY/PR| - |--------|--------|--------|--------| - | 7 | 8 | 9 | -- | - | ADD | REPLY | MAIL |READ/NEW| - | ADD/EDI|RP/ED/EX|M/NOHEAD|SHOW NEW| - |--------|--------|--------|--------| - | 4 | 5 | 6 | , | - | CURRENT| RESPOND| LAST | DIR/NEW| - |CURR/EDI|RS/ED/EX| | INDEX | - |--------|--------|--------|--------| - | 1 | 2 | 3 |ENTER | - | BACK | PRINT | DIR | | - | NEXT |P/NONOTI|DIR/FOLD| | - |--------+--------|--------| ENTER | - | 0 | . | SELECT | - | SHOW FOLDER/FULL| DELETE | | - | SHOW FLAGS | UNDELE | | - +-----------------+--------+--------+`, - }, "LAST": { Description: `Displays the last message in the current folder. Format: - LAST`, + LAST`, Flags: dclish.Flags{ "/EDIT": { - Description: `Specifies that the editor is to be used to read the message. This is -useful for scanning a long message.`, + Description: ` Specifies that the editor is to be used to read the message. This is + useful for scanning a long message.`, }, "/HEADER": { Description: `/[NO]HEADER -Specifies that if a message header exists, the header will be shown. -If /HEADER or /NOHEADER is specified, the setting will apply for all -further reads in the selected folder. The default is /HEADER.`, + Specifies that if a message header exists, the header will be shown. + If /HEADER or /NOHEADER is specified, the setting will apply for all + further reads in the selected folder. The default is /HEADER.`, }, }, }, "MAIL": { - Description: `Invokes the VAX/VMS Personal Mail Utility (MAIL) to send the message + Description: `Invokes the VAX/VMS Personal Mail Utility (MAIL) to send the message which you are reading to the specified recipients. Format: - MAIL recipient-name[s] -The input for the recipient name is exactly the same format as used by -the MAIL command at DCL level. Note that this means when specifying an -address that has quotes, in order to pass the quotes you must specify -triple quotes. I.e. a network address of the form xxx%"address" must -be specified as xxx%"""address""".`, +The input for the recipient name is exactly the same format as used by +the MAIL command at DCL level. Note that this means when specifying an +address that has quotes, in order to pass the quotes you must specify +triple quotes. I.e. a network address of the form xxx%"address" must be +specified as xxx%"""address""".`, MinArgs: 1, MaxArgs: 10, Flags: dclish.Flags{ "/EDIT": { - Description: `Specifies that the editor is to be used to edit the message before -mailing it.`, + Description: ` Specifies that the editor is to be used to edit the message before + mailing it.`, }, "/HEADER": { Description: `/[NO]HEADER -Controls whether a header containing the owner, subject, and date of the -message is written in the mail. The default is to write the header.`, + Controls whether a header containing the owner, subject, and date of + the message is written in the mail. The default is to write the + header.`, }, "/SUBJECT": { Description: `/SUBJECT=text -Specifies the subject of the mail message. If the text consists of more -than one word, enclose the text in quotation marks ("). + Specifies the subject of the mail message. If the text consists of more + than one word, enclose the text in quotation marks ("). -If you omit this qualifier, the description of the message will be used -as the subject.`, + If you omit this qualifier, the description of the message will be used + as the subject.`, OptArg: true, }, }, }, "MARK": { - Description: `Sets the current or message-id message as marked. Marked messages are -displayed with an asterisk in the left hand column of the directory -listing. A marked message can serve as a reminder of important -information. The UNMARK command sets the current or message-id message + Description: `Sets the current or message-id message as marked. Marked messages are +displayed with an asterisk in the left hand column of the directory +listing. A marked message can serve as a reminder of important +information. The UNMARK command sets the current or message-id message as unmarked. Format: @@ -730,16 +720,17 @@ as unmarked. MARK [message-number or numbers] UNMARK [message-number or numbers] -NOTE: The list of marked messages are stored in a file username.BULLMARK. -The files are created in the directory pointed to by the logical name -BULL_MARK. If BULL_MARK is not defined, SYS$LOGIN will be used.`, +NOTE: The list of marked messages are stored in a file +username.BULLMARK. The files are created in the directory pointed to by +the logical name BULL_MARK. If BULL_MARK is not defined, SYS$LOGIN will +be used.`, MaxArgs: 1, }, "UNMARK": { - Description: `Sets the current or message-id message as marked. Marked messages are -displayed with an asterisk in the left hand column of the directory -listing. A marked message can serve as a reminder of important -information. The UNMARK command sets the current or message-id message + Description: `Sets the current or message-id message as marked. Marked messages are +displayed with an asterisk in the left hand column of the directory +listing. A marked message can serve as a reminder of important +information. The UNMARK command sets the current or message-id message as unmarked. Format: @@ -747,53 +738,45 @@ as unmarked. MARK [message-number or numbers] UNMARK [message-number or numbers] -NOTE: The list of marked messages are stored in a file username.BULLMARK. -The files are created in the directory pointed to by the logical name -BULL_MARK. If BULL_MARK is not defined, SYS$LOGIN will be used.`, +NOTE: The list of marked messages are stored in a file +username.BULLMARK. The files are created in the directory pointed to by +the logical name BULL_MARK. If BULL_MARK is not defined, SYS$LOGIN will +be used.`, MaxArgs: 1, }, "MODIFY": { - Description: `Modifies the database information for the current folder. Only the -owner of the folder or a user with privileges can use this command. + Description: `Modifies the database information for the current folder. Only the owner +of the folder or a user with privileges can use this command. Format: - MODIFY`, Action: ActionModify, Flags: dclish.Flags{ "/DESCRIPTION": { - Description: `Specifies a new description for the folder. You will be prompted for -the text of the description. - -NOTE: If this folder is to receive messages from a network mailing list -via the BBOARD feature, and you wish to use the POST and RESPOND/LIST -commands, the address of the mailing list should be included in the -description. This is done by enclosing the address using <> and -placing it at the end of the description, i.e. - - INFOVAX MAILING LIST <IN%"INFO-VAX@KL.SRI.COM">`, + Description: ` Specifies a new description for the folder. You will be prompted for + the text of the description.`, }, "/ID": { - Description: `Designates that the name specified as the owner name is a rights -identifier. The creator's process must have the identifier presently -assigned to it. Any process which has that identifier assigned to it -will be able to control the folder as if it were the folder's owner. -This is used to allow more than one use to control a folder. + Description: ` Designates that the name specified as the owner name is a rights + identifier. The creator's process must have the identifier presently + assigned to it. Any process which has that identifier assigned to it + will be able to control the folder as if it were the folder's owner. + This is used to allow more than one use to control a folder. -Note: This feature will not work during remote access to the folder.`, + Note: This feature will not work during remote access to the folder.`, }, "/NAME": { Description: `/NAME=foldername -Specifies a new name for the folder.`, + Specifies a new name for the folder.`, OptArg: true, }, "/OWNER": { Description: `/OWNER=username -Specifies a new owner for the folder. If the owner does not have -privileges, BULLETIN will prompt for the password of the new owner -account in order to okay the modification. See also /ID.`, + Specifies a new owner for the folder. If the owner does not have + privileges, BULLETIN will prompt for the password of the new owner + account in order to okay the modification. See also /ID.`, OptArg: true, }, }, @@ -803,211 +786,213 @@ account in order to okay the modification. See also /ID.`, folder. Format: - MOVE folder-name [message_number][-message_number1] -The folder-name is the name of the folder to which the message is to be -be moved to. Optionally, a range of messages which are to be moved can be -specified following the folder name, i.e. COPY NEWFOLDER 2-5. However, -if the old folder is remote, they will be copied but not deleted, as -only one message can be delted from a remote folder at a time. +The folder-name is the name of the folder to which the message is to be +be moved to. Optionally, a range of messages which are to be moved can +be specified following the folder name, i.e. COPY NEWFOLDER 2-5. +However, if the old folder is remote, they will be copied but not +deleted, as only one message can be delted from a remote folder at a +time. -The key words CURRENT and LAST can also be specified in the range, -in place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc.`, +The key words CURRENT and LAST can also be specified in the range in, +place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc.`, MinArgs: 1, MaxArgs: 2, Flags: dclish.Flags{ "/ALL": { - Description: `Specifies to move all the messages from the old folder. Note: If the -old folder is remote, they will be copied but not deleted, as only one -message can be deleted from a remote folder at a time.`, + Description: ` Specifies to move all the messages from the old folder. Note: If the + old folder is remote, they will be copied but not deleted, as only one + message can be deleted from a remote folder at a time.`, }, "/MERGE": { - Description: `Specifies that the original date and time of the moved messages are -saved and that the messages are placed in correct chronological order -in the new folder. This operation is lengthy if the new folder is large.`, + Description: ` Specifies that the original date and time of the moved messages are + saved and that the messages are placed in correct chronological order + in the new folder. This operation is lengthy if the new folder is + large.`, }, "/ORIGINAL": { - Description: `Specifies that the owner of the moved message will be the original owner -of the message. The default is that the moved message will be owned by -the person moving the message.`, + Description: ` Specifies that the owner of the moved message will be the original + owner of the message. The default is that the moved message will be + owned by the person moving the message.`, }, }, }, "NEXT": { - Description: `Skips to the next message and displays it. This is useful when paging -through the messages and you encounter a particularly long message -that you would like to skip over.`, + Description: `Skips to the next message and displays it. This is useful when paging +through the messages and you encounter a particularly long message that +you would like to skip over.`, + Action: ActionNext, Flags: dclish.Flags{ "/EDIT": { - Description: `Specifies that the editor is to be used to read the message. This is -useful for scanning a long message.`, + Description: ` Specifies that the editor is to be used to read the message. This is + useful for scanning a long message.`, }, "/HEADER": { Description: `/[NO]HEADER -Specifies that if a message header exists, the header will be shown. -If /HEADER or /NOHEADER is specified, the setting will apply for all -further reads in the selected folder. The default is /HEADER.`, + Specifies that if a message header exists, the header will be shown. + If /HEADER or /NOHEADER is specified, the setting will apply for all + further reads in the selected folder. The default is /HEADER.`, }, }, }, "PRINT": { - Description: `Queues a copy of the message you are currently reading (or have -just read) for printing. The file created by the PRINT command -is not released to the print queue until you exit, unless you add -the qualifier /NOW or change one of the print job's qualifiers. -Multiple messages are concatenated into one print job. + Description: `Queues a copy of the message you are currently reading (or have just +read) for printing. The file created by the PRINT command is not +released to the print queue until you exit, unless you add the qualifier +/NOW or change one of the print job's qualifiers. Multiple messages are +concatenated into one print job. Format: - PRINT [message_number][-message_number1],[...] -A range of messages to be printed can optionally be specified, i.e. +A range of messages to be printed can optionally be specified, i.e. PRINT 2-5. -The key words CURRENT and LAST can also be specified in the range, -in place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc. +The key words CURRENT and LAST can also be specified in the range, in +place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc. -NOTE: The qualifier /PRINT is present on the DIRECTORY command. This -provides more flexibility than is present with the PRINT command. For -example, if you want to print all messages with a particular string in +NOTE: The qualifier /PRINT is present on the DIRECTORY command. This +provides more flexibility than is present with the PRINT command. For +example, if you want to print all messages with a particular string in it's subject line, DIRECTORY/PRINT/SUBJ would allow you do it.`, MaxArgs: 1, Flags: dclish.Flags{ "/ALL": { - Description: `Prints all the messages in the current folder.`, + Description: ` Prints all the messages in the current folder.`, }, "/FORM": { - Description: `Specifies the name or number of the form that you want for the print -job. Codes for form types are installation-defined. You can use the -SHOW QUEUE/FORM command at DCL level to find out the form types -available for your system. Use the SHOW QUEUE/FULL command at DCL -level to find out the name of the mounted form and the default form for -a particular queue. If you specify a form whose stock is different -from the stock of the form mounted on the queue, your job is placed in -a pending state until the stock of the mounted form of the queue is -set equal to the stock of the form associated with the job. (In order -to have your job print, the system manager should stop the queue, -physically change the paper stock on the output device, and restart the -queue specifying the new form type as the mounted form.)`, + Description: ` Specifies the name or number of the form that you want for the print + job. Codes for form types are installation-defined. You can use the + SHOW QUEUE/FORM command at DCL level to find out the form types + available for your system. Use the SHOW QUEUE/FULL command at DCL + level to find out the name of the mounted form and the default form + for a particular queue. If you specify a form whose stock is different + from the stock of the form mounted on the queue, your job is placed in + a pending state until the stock of the mounted form of the queue is + set equal to the stock of the form associated with the job. (In order + to have your job print, the system manager should stop the queue, + physically change the paper stock on the output device, and restart + the queue specifying the new form type as the mounted form.)`, }, "/HEADER": { Description: `/[NO]HEADER -Controls whether a header containing the owner, subject, and date of the -message is printed at the beginning. The default is to write the header.`, + Controls whether a header containing the owner, subject, and date of the + message is printed at the beginning. The default is to write the header.`, }, "/NOTIFY": { Description: `/[NO]NOTIFY -Indicates that you will be notified by a broadcast message when the -file or files have been printed. If /NONOTIFY is specified, there -is no notification. The default is /NOTIFY.`, + Indicates that you will be notified by a broadcast message when the + file or files have been printed. If /NONOTIFY is specified, there is + no notification. The default is /NOTIFY.`, Default: "true", }, "/NOW": { - Description: `Sends all messages that have been queued for printing with the PRINT -command during this session to the printer.`, + Description: ` Sends all messages that have been queued for printing with the PRINT + command during this session to the printer.`, }, "/QUEUE": { Description: `/QUEUE=queue_name -The name of the queue to which a message is to be sent. If the /QUEUE -qualifier is not specified, the message is queued to SYS$PRINT.`, + The name of the queue to which a message is to be sent. If the /QUEUE + qualifier is not specified, the message is queued to SYS$PRINT.`, OptArg: true, }, }, }, "READ": { - Description: `Displays the specified message. If you do not specify a message, then -the first time you enter the command, the first message in the folder -will be displayed. However, if there are new messages, the first new -message will be displayed. Each time you enter the command, the next + Description: `Displays the specified message. If you do not specify a message, then +the first time you enter the command, the first message in the folder +will be displayed. However, if there are new messages, the first new +message will be displayed. Each time you enter the command, the next page, or if there are no more pages, the next message will be displayed. Format: READ [message-number] -The message's relative number is found by the DIRECTORY command. -If you specify a number greater than the number of messages in the -folder, the last message in the folder will be displayed. +The message's relative number is found by the DIRECTORY command. If you +specify a number greater than the number of messages in the folder, the +last message in the folder will be displayed. -NOTE: The READ command can be abbreviated by omitting the READ command, -i.e. typing the command "2" is equivalent to "READ 2", and simply +NOTE: The READ command can be abbreviated by omitting the READ command, +i.e. typing the command "2" is equivalent to "READ 2", and simply hitting the <RETURN> key is equivalent to "READ". -BULLETIN normally stores only the latest message that has been read per -folder. It can optionally store and display which messages have been -read in a folder on a per message basis. For information on this, see +BULLETIN normally stores only the latest message that has been read per +folder. It can optionally store and display which messages have been +read in a folder on a per message basis. For information on this, see the help on the SEEN command.`, MaxArgs: 1, + Action: ActionRead, Flags: dclish.Flags{ "/ALL": { - Description: `Specifies to read all messages. Used after /MARKED, /UNMARKED, /SEEN, -or /UNSEEN had been specified.`, + Description: ` Specifies to read all messages. Used after /MARKED, /UNMARKED, /SEEN, + or /UNSEEN had been specified.`, }, "/EDIT": { - Description: `Specifies that the editor is to be used to read the message. This is -useful for scanning a long message.`, + Description: ` Specifies that the editor is to be used to read the message. This is + useful for scanning a long message.`, }, "/HEADER": { Description: `/[NO]HEADER -Specifies that if a message header exists, the header will be shown. -If /HEADER or /NOHEADER is specified, the setting will apply for all -further reads in the selected folder. The default is /HEADER.`, + Specifies that if a message header exists, the header will be shown. + If /HEADER or /NOHEADER is specified, the setting will apply for all + further reads in the selected folder. The default is /HEADER.`, }, "/MARKED": { - Description: `Specifies to read only messages that have been marked (marked messages -are indicated by an asterisk). Using /MARKED is equivalent to -selecting the folder with /MARKED, i.e. only marked messages will be -shown and be able to be read. To see all messages, use either /ALL, -or reselect the folder.`, + Description: ` Specifies to read only messages that have been marked (marked messages + are indicated by an asterisk). Using /MARKED is equivalent to + selecting the folder with /MARKED, i.e. only marked messages will be + shown and be able to be read. To see all messages, use either /ALL, or + reselect the folder.`, }, "/UNMARKED": { - Description: `Specifies to read only messages that have not been marked (marked -messages are indicated by an asterisk). Using /UNMARKED is equivalent -to selecting the folder with /UNMARKED, i.e. only unmarked messages -will be shown and be able to be read. To see all messages, either -reselect the folder or specify /ALL.`, + Description: ` Specifies to read only messages that have not been marked (marked + messages are indicated by an asterisk). Using /UNMARKED is equivalent + to selecting the folder with /UNMARKED, i.e. only unmarked messages + will be shown and be able to be read. To see all messages, either + reselect the folder or specify /ALL.`, }, "/SEEN": { - Description: `Specifies to read only messages that have been seen (indicated by a -greater than sign). Using /SEEN is equivalent to selecting the folder -with /SEEN, i.e. only seen messages will be shown and be able to be -read. To see all messages, use either /ALL, or reselect the folder.`, + Description: ` Specifies to read only messages that have been seen (indicated by a + greater than sign). Using /SEEN is equivalent to selecting the folder + with /SEEN, i.e. only seen messages will be shown and be able to be + read. To see all messages, use either /ALL, or reselect the folder.`, }, "/UNSEEN": { - Description: `Specifies to read only messages that have not been seen (seen message -are indicated by a greater than sign). Using /UNSEEN is equivalent to -selecting the folder with /UNSEEN, i.e. only unseen messages will be -shown and be able to be read. To see all messages, use either /ALL, or -reselect the folder.`, + Description: ` Specifies to read only messages that have not been seen (seen message + are indicated by a greater than sign). Using /UNSEEN is equivalent to + selecting the folder with /UNSEEN, i.e. only unseen messages will be + shown and be able to be read. To see all messages, use either /ALL, or + reselect the folder.`, }, "/NEW": { - Description: `Specifies to read the first unread message.`, + Description: ` Specifies to read the first unread message.`, }, "/PAGE": { Description: `/[NO]PAGE -Specifies that the display of the message will pause when it reaches the -end of the page. If /NOPAGE is specified, the whole message will be -displayed. This is useful for terminals that can store more than one -screenful at a time, and that have a remote printer that can then print -the contents of the terminal's memory.`, + Specifies that the display of the message will pause when it reaches + the end of the page. If /NOPAGE is specified, the whole message will + be displayed. This is useful for terminals that can store more than + one screenful at a time, and that have a remote printer that can then + print the contents of the terminal's memory.`, }, "/SINCE": { Description: `/SINCE=date -Specifies to read the first message created on or after the specified -date. If no date is specified, the default is TODAY.`, + Specifies to read the first message created on or after the specified + date. If no date is specified, the default is TODAY.`, OptArg: true, }, }, }, "REMOVE": { - Description: `Removes a folder. Only the owner of a folder or a privileged user can + Description: `Removes a folder. Only the owner of a folder or a privileged user can remove the folder. Format: @@ -1024,81 +1009,82 @@ the same as the ADD command except for /NOINDENT and /EXTRACT. Format: REPLY [file-name]`, MaxArgs: 1, + Action: ActionReply, Flags: dclish.Flags{ "/EDIT": { - Description: `Specifies that the editor is to be used for creating the reply -message.`, + Description: ` Specifies that the editor is to be used for creating the reply + message.`, }, "/EXTRACT": { - Description: `Specifies that the text of the message should be included in the reply -message. This qualifier is valid only when used with /EDIT. The -text of the message is indented with > at the beginning of each line. -This can be suppressed with /NOINDENT.`, + Description: ` Specifies that the text of the message should be included in the reply + message. This qualifier is valid only when used with /EDIT. The text + of the message is indented with > at the beginning of each line. This + can be suppressed with /NOINDENT.`, }, "/INDENT": { - Description: `See /EXTRACT for information on this qualifier. + Description: ` See /EXTRACT for information on this qualifier. -Defaults to set - use /NOINDENT to suppress.`, + Defaults to set - use /NOINDENT to suppress.`, Default: "true", }, }, }, "RESPOND": { - Description: `Invokes the VAX/VMS Personal Mail Utility (MAIL) to send a reply mail + Description: `Invokes the VAX/VMS Personal Mail Utility (MAIL) to send a reply mail message to the owner of the currently read message. Format: RESPOND [file-name] -If you wish to use another method for sending the mail, define BULL_MAILER -to point to a command procedure. This procedure will then be executed in -place of MAIL, and the parameters passed to it are the username and subject -of the message.`, +If you wish to use another method for sending the mail, define +BULL_MAILER to point to a command procedure. This procedure will then be +executed in place of MAIL, and the parameters passed to it are the +username and subject of the message.`, MaxArgs: 1, Flags: dclish.Flags{ "/CC": { Description: `/CC=user[s] -Specifies additional users that should receive the reply.`, + Specifies additional users that should receive the reply.`, OptArg: true, }, "/EDIT": { - Description: `Specifies that the editor is to be used for creating the reply mail -message.`, + Description: ` Specifies that the editor is to be used for creating the reply mail + message.`, }, "/EXTRACT": { - Description: `Specifies that the text of the message should be included in the reply -mail message. This qualifier is valid only when used with /EDIT. The -text of the message is indented with > at the beginning of each line. -This can be suppressed with /NOINDENT.`, + Description: ` Specifies that the text of the message should be included in the reply + mail message. This qualifier is valid only when used with /EDIT. The + text of the message is indented with > at the beginning of each line. + This can be suppressed with /NOINDENT.`, }, "/LIST": { - Description: `Specifies that the reply should also be sent to the network mailing list -associated with the folder. The mailing list address should be stored -in the folder description. See CREATE/DESCRIPTION or MODIFY/DESCRIPTION -for more informaton.`, + Description: ` Specifies that the reply should also be sent to the network mailing + list associated with the folder. The mailing list address should + be stored in the folder description. See CREATE/DESCRIPTION or + MODIFY/DESCRIPTION for more informaton.`, }, "/INDENT": { - Description: `See /EXTRACT for information on this qualifier. + Description: ` See /EXTRACT for information on this qualifier. -Defaults to set - use /NOINDENT to suppress.`, + Defaults to set - use /NOINDENT to suppress.`, Default: "true", }, "/SIGNATURE": { - Description: `Specifies to automatically appended signature, if one exists. -Signatures are appended for postings to mailing lists and to responds. -See the help topic POST Signature_file for signature information. + Description: ` Specifies to automatically appended signature, if one exists. + Signatures are appended for postings to mailing lists and to responds. + See the help topic POST Signature_file for signature information . -Defaults to set - use /NOSIGNATURE to suppress.`, + Defaults to set - use /NOSIGNATURE to suppress.`, Default: "true", }, "/SUBJECT": { Description: `/SUBJECT=text -Specifies the subject of the mail message. If the text consists of more -than one word, enclose the text in quotation marks ("). + Specifies the subject of the mail message. If the text consists of + more than one word, enclose the text in quotation marks ("). -If you omit this qualifier, the description of the message will be used -as the subject preceeded by "RE: ".`, + If you omit this qualifier, the description of the message will be + used as the subject preceeded by "RE: ".`, OptArg: true, }, }, @@ -1108,63 +1094,64 @@ as the subject preceeded by "RE: ".`, Action: ActionQuit, }, "SEARCH": { - Description: `Searches the currently selected folder for the message containing the + Description: `Searches the currently selected folder for the message containing the first occurrence of the specified text string. Format: SEARCH [search-string] -The search starts from the first message in the current folder. The -search includes both the text of the message, and the description header. -If a "search-string" is not specified, a search is made using the -previously specified string, starting with the message following the -one you are currently reading (or have just read). Once started, a +The search starts from the first message in the current folder. The +search includes both the text of the message, and the description +header. If a "search-string" is not specified, a search is made using +the previously specified string, starting with the message following the +one you are currently reading (or have just read). Once started, a search can be aborted by typing a CTRL-C.`, MinArgs: 1, MaxArgs: 1, Flags: dclish.Flags{ "/EDIT": { - Description: `Specifies that the editor is to be used for reading the message.`, + Description: ` Specifies that the editor is to be used for reading the message.`, }, "/FOLDER": { Description: `/FOLDER=(folder,[...]) -Specifies a list of folders to be searched. The search will start by -selecting the first folder in the list and searching the messages for -a match. If, during a search, no more matches or messages are found, -the next folder in the list is automatically selected. The presently -selected folder can be included in the search by specifying "" as the -first folder in the list.`, + Specifies a list of folders to be searched. The search will start by + selecting the first folder in the list and searching the messages for + a match. If, during a search, no more matches or messages are found, + the next folder in the list is automatically selected. The presently + selected folder can be included in the search by specifying "" as the + first folder in the list.`, OptArg: true, }, "/REPLY": { - Description: `Specifies that messages are to be searched for that are replies to the -currently read message, or the message specified by /START. Replies are -messages which have subject of the original message prefaced by "Re:".`, + Description: ` Specifies that messages are to be searched for that are replies to the + currently read message, or the message specified by /START. Replies + are messages which have subject of the original message prefaced by + "Re:".`, }, "/REVERSE": { - Description: `Specifies that the messages are to be searched in reverse order. If -no starting message is specified, the search is started from the last -message.`, + Description: ` Specifies that the messages are to be searched in reverse order. If no + starting message is specified, the search is started from the last + message.`, }, "/START": { Description: `/START=message_number -Specifies the message number to start the search at.`, + Specifies the message number to start the search at.`, OptArg: true, }, "/SUBJECT": { - Description: `Specifies that only the subject of the messages are to be searched.`, + Description: ` Specifies that only the subject of the messages are to be searched.`, }, }, }, "SEEN": { - Description: `Sets the current or message-id message as seen. This allows you to keep -track of messages on a per message basis. Seen messages are displayed -with a greater than sign in the left hand column of the directory -listing. Once you have used the SEEN command once, messages will be -automatically be set as being SEEN when they are read. The UNSEEN + Description: `Sets the current or message-id message as seen. This allows you to keep +track of messages on a per message basis. Seen messages are displayed +with a greater than sign in the left hand column of the directory +listing. Once you have used the SEEN command once, messages will be +automatically be set as being SEEN when they are read. The UNSEEN command sets the current or message-id message as unseen. Format: @@ -1172,23 +1159,23 @@ command sets the current or message-id message as unseen. SEEN [message-number or numbers] UNSEEN [message-number or numbers] -If you have used the SEEN command and wish to disable the automatic -marking of messages in regular folders as SEEN when they are read, type -the command SEEN/NOREAD. To reenable, simply use the SEEN command again. +If you have used the SEEN command and wish to disable the automatic +marking of messages in regular folders as SEEN when they are read, type +the command SEEN/NOREAD. To reenable, simply use the SEEN command again. -NOTE: The list of SEEN messages are stored in a -file username.BULLMARK. NEWSMARK. The files are created in the directory -pointed to by the logical name BULL_MARK. If BULL_MARK is not defined, -SYS$LOGIN will be used.`, +NOTE: The list of SEEN messages are stored in a file username.BULLMARK. +NEWSMARK. The files are created in the directory pointed to by the +logical name BULL_MARK. If BULL_MARK is not defined, SYS$LOGIN will be +used.`, MinArgs: 1, MaxArgs: 1, }, "UNSEEN": { - Description: `Sets the current or message-id message as seen. This allows you to keep -track of messages on a per message basis. Seen messages are displayed -with a greater than sign in the left hand column of the directory -listing. Once you have used the SEEN command once, messages will be -automatically be set as being SEEN when they are read. The UNSEEN + Description: `Sets the current or message-id message as seen. This allows you to keep +track of messages on a per message basis. Seen messages are displayed +with a greater than sign in the left hand column of the directory +listing. Once you have used the SEEN command once, messages will be +automatically be set as being SEEN when they are read. The UNSEEN command sets the current or message-id message as unseen. Format: @@ -1196,14 +1183,14 @@ command sets the current or message-id message as unseen. SEEN [message-number or numbers] UNSEEN [message-number or numbers] -If you have used the SEEN command and wish to disable the automatic -marking of messages in regular folders as SEEN when they are read, type -the command SEEN/NOREAD. To reenable, simply use the SEEN command again. +If you have used the SEEN command and wish to disable the automatic +marking of messages in regular folders as SEEN when they are read, type +the command SEEN/NOREAD. To reenable, simply use the SEEN command again. -NOTE: The list of SEEN messages are stored in a -file username.BULLMARK. NEWSMARK. The files are created in the directory -pointed to by the logical name BULL_MARK. If BULL_MARK is not defined, -SYS$LOGIN will be used.`, +NOTE: The list of SEEN messages are stored in a file username.BULLMARK. +NEWSMARK. The files are created in the directory pointed to by the +logical name BULL_MARK. If BULL_MARK is not defined, SYS$LOGIN will be +used.`, MinArgs: 1, MaxArgs: 1, }, @@ -1230,9 +1217,9 @@ message.`, MaxArgs: 1, Flags: dclish.Flags{ "/MARKED": { - Description: `Selects only messages that have been marked (indicated by an asterisk). -After using /MARKED, in order to see all messages, the folder will have -to be reselected.`, + Description: ` Selects only messages that have been marked (indicated by an asterisk). + After using /MARKED, in order to see all messages, the folder will have + to be reselected.`, }, }, }, @@ -1241,16 +1228,14 @@ to be reselected.`, characteristics of the BULLETIN Utility. Format: - SET option`, Flags: dclish.Flags{ "ACCESS": { - Description: `Controls access to a private folder. A private folder can only be + Description: ` Controls access to a private folder. A private folder can only be selected by users who have been granted access. Only the owner of that folder is allowed to grant access. Format: - SET [NO]ACCESS id-name [folder-name] The id-name can be one or more ids from the system Rights Database for @@ -1315,7 +1300,7 @@ have manually reset those defaults. The correct solution requires a large programming modification, which will be done in a later version.`, }, "ALWAYS": { - Description: `Specifies that the selected folder has the ALWAYS attribute. This + Description: ` Specifies that the selected folder has the ALWAYS attribute. This causes messages in the folder to be displayed differently when logging in. SYSTEM messages will be displayed every time a user logs in, rather than just once. Non-SYSTEM message will also be displayed every time @@ -1325,138 +1310,10 @@ meant for messages which are very important, and thus you want to make sure they are read. Format: - SET [NO]ALWAYS`, - }, - "BBOARD": { - Description: `Specifies a username to be used as a BBOARD destination. Mail which is -sent to that user are converted into messages. This command will apply -to the selected folder, and each folder can have its own BBOARD. Only -privileged users or owners of the folders can set BBOARD. Note: The -specified account must have the DISUSER flag specified in the system -authorization file, and it either must be given SYSPRV privileges, or -the scratch bboard_directory (specified when compiling BULLETIN) must -have world rwed protection. Also, certain system parameters which -affect detached subprocesses are usually too low for the subprocess -which is spawned to read the mail. The parameters and the suggested -values are: PQL_DPGFLQUOTA = 10000, PQL_DWSQUOTA = 500, and PQL_DFILLM -= 30. If you are not using the BULLCP process, the subprocess limit for -users must be at least 2. - - Format: - - SET BBOARD [username] - -If BULLCP is running, BBOARD is updated every 15 minutes. If you want -to length this period, define BULL_BBOARD_UPDATE to be the number of -minutes, between updates. I.e. DEFINE/SYSTEM BULL_BBOARD_UPDATE "30" -will cause the updates to be don every 30 minutes. - -NOTE: If you want to control the expiration date on a per message basis, -you can do so by adding a special header line to the message. The form -is Expires: or X-Expires: followed by the date in the form DD MMM YYYY. -The time will always be 00:00, even if the time is specified on the line. -3 /EXPIRATION - /EXPIRATION=days - /NOEXPIRATION - -Specifies the number of days the message created by the BBOARD is to be -retained. The default is 14 days. The highest limit that can be -specified is 30 days. This can be overridden by a user with privileges. -If /NOEXPIRATION is specified, messages will become permanent. - -NOTE: This value is the same value as specified by SET DEFAULT_EXPIRE. -If one is changed, the other will change also. -3 /SPECIAL -Specifies that the input should be processed using a special command -procedure, and not to use the simple VMS MAIL to message conversion. -Specifying a username is optional. To remove this feature, you must -either SET NOBBOARD, or SET BBOARD and specify a username. See -installation notes for exactly how to use this feature. -3 /VMSMAIL -Used in conjunction with /SPECIAL. If /SPECIAL and a username is -specified, and the conversion still takes its input from VMS MAIL, then -the VMS system mail file is checked to see if new mail exists for the -specified user before running the command procedure. This saves time -and avoids creating subprocesses. (Useful if input is digest format.) -3 Listserv -For a LISTSERV mailing list, only a subscribed user can post to it. If -the BBOARD account is subscribed to the list in order for BULLETIN to -receive the list, only the BBOARD account will be able to post to it. -This problem is solved by placing the word LISTSERV in the folder -description line. Then, messages sent to the mailing list by the POST -command will be sent from the BBOARD account rather than from the user's -account. For example, the folder description might be: - -FAKE MAILING LIST <FAKELIST@FAKENODE.BITNET> LISTSERV. - -If you have PMDF or MX installed, the corresponding logical name -PMDF_REPLY_TO or MX_REPLY_TO will be temporarily defined in order to add -a REPLY-TO: line to the message header to display the real user's -address. - -Users who use the method described in HELP SET BBOARD MORE_INFORMATION -should note the following: When using this LISTSERV feature, the BBOARD -account must be a real account, not simply a VMS MAIL forwarding entry. -Mail can only be sent from a real account. However, if mail forwarding -is set for that the account, the account does not need a real directory -or a unique uic, since it will not need space to store mail. - -In order to be able to send LISTSERV commands from the BBOARD account -without having to actually login to the BBOARD account, there is a -utility included with BULLETIN called SETUSER. This requires privileges -to use. After compiling it, use the link command: - - LINK SETUSER,SYS$SYSTEM:SYS.STB/SELECT - -When you run it, it will prompt for a username. After verifying that -the given username is a valid account, it will then change your -process's username. You can then send mail from that account. - -If you are using PMDF or MX, and wish to use this feature, you can still -do so by setting BBOARD. As long as the BBOARD account is not a real -account, it will work properly, even though the mail feed is not really -coming from the BBOARD account. - -In order to find out if the LISTSERV mailing list will accept posts only -from subscribed users, send the command 'REV listname'. This will -retrieve the file listname.LIST. It begins with a list of keywords. If -the keyword 'send' is set to 'public', you don't need to set the -LISTSERV switch. If it's set to 'private', you do. For a description -of the keywords and the meaning of their settings, send any LISTSERV the -command 'INFO KEY'. Note that the 'listname.LIST' files include a list -of owners and subscribers. If 'send' is set to 'owners', then neither -the public nor the subscribers can post to the list. - -3 More_information -If more than one folder is to have a BBOARD setting, only one of the -BBOARD names need be a real account. All other names could be names -whose mail is forwarded to the real account. BULLETIN will then -determine from the mail header which folder the mail is to be sent to. -Forwarding can be enabled for any name within MAIL by the command: - - MAIL> SET FORWARD/USER=from_name to_name - -Any mail sent to FROM_NAME will be forwarded to TO_NAME. Thus, only -TO_NAME need be a real account. For example, if you have INFOVAX and -LASER-LOVERS folders, you need create only a INFOVAX account, and then -forward LASER-LOVERS mail to INFOVAX within mail using the command SET -FORWARD/USER=LASER-LOVERS INFOVAX. You would then do a SET BBOARD -INFOVAX for the INFOVAX folder, and SET BBOARD LASER-LOVERS for the -LASER-LOVERS folder. This method will speed up the BBOARD conversion, -since mail need be read only from one account. NOTE: Folders that have -the /SPECIAL set on their BBOARD accounts cannot have their mail -forwarded to BBOARD accounts that don't have /SPECIAL set. Folders of -the same type, i.e. that use the same /SPECIAL command procedure, must -be grouped separately. - -The BBOARD account must match the mailing list name. If you prefer not -to have them match, then you must include the actual address of the -mailing list in the folder description in the format described under -HELP CREATE /DESCRIPTION.`, }, "BRIEF": { - Description: `Controls whether you will be alerted upon logging that there are new + Description: ` Controls whether you will be alerted upon logging that there are new messages in the currently selected folder. A new message is defined as one that has been created since the last time you logged in or accessed BULLETIN. Note the difference between BRIEF and READNEW. The latter @@ -1465,7 +1322,6 @@ and prompts the user to read the messages. Setting BRIEF will clear a READNEW setting (and visa versa). Format: - SET [NO]BRIEF 3 /ALL Specifies that the SET [NO]BRIEF option is the default for all users for @@ -1487,21 +1343,20 @@ individual, except if changing to SHOWNEW or READNEW. This is a privileged qualifier.`, }, "CONTINUOUS_BRIEF": { - Description: `Specifies that if BRIEF is set for a folder, and there are new messages, + Description: ` Specifies that if BRIEF is set for a folder, and there are new messages, the notification message "there are new messages" will be displayed every time when logging in, until the new messages are read. Normally, the BRIEF setting causes notification only at the first time that new messages are detected. Format: - SET [NO]CONTINUOUS_BRIEF NOTE: Both SET GENERIC and SET CONTINUOUS_BRIEF cannot be set for the same user.`, }, "DEFAULT_EXPIRE": { - Description: `Specifies the number of days the message created by BBOARD (or direct + Description: ` Specifies the number of days the message created by BBOARD (or direct PMDF path) is to be retained. The default is 14 days. The highest limit that can be specified is 30 days. This can be overridden by a user with privileges. @@ -1512,7 +1367,6 @@ prompting has been disabled via SET NOPROMPT_EXPIRE, this value will be used. Format: - SET DEFAULT_EXPIRE days If -1 is specified, messages will become permanent. If 0 is specified, @@ -1522,35 +1376,20 @@ disappear. NOTE: This value is the same value that SET BBOARD/EXPIRATION specifies. If one is changed, the other will change also.`, - }, - "DIGEST": { - Description: `Affect only messages which are added via either the BBOARD option, or -written directly from a network mailing program (i.e. PMDF). Several -mailing lists use digest format to send their messages, i.e. the -messages are concatenated into one long message. If DIGEST is set, the -messages will be separated into individual BULLETIN messages. - - Format: - - SET [NO]DIGEST - -The command SHOW FOLDER/FULL will show if DIGEST has been set. -`, }, "DUMP": { - Description: `Specifies that messages deleted from the selected folder are written + Description: ` Specifies that messages deleted from the selected folder are written into a dump (or log) file. The name of the log file is foldername.LOG, and it is located in the folder directory. Format: - SET [NO]DUMP The command SHOW FOLDER/FULL will show if dump has been set. (NOTE: SHOW FOLDER/FULL is a privileged command.)`, }, "EXPIRE_LIMIT": { - Description: `Specifies expiration limit that is allowed for messages. Non-privileged + Description: ` Specifies expiration limit that is allowed for messages. Non-privileged users cannot specify an expiration that exceeds the number of days specified. Privileged users can exceed the limit. @@ -1560,11 +1399,10 @@ The command SHOW FOLDER/FULL will show the expiration limit, if one exists. (NOTE: SHOW FOLDER/FULL is a privileged command.)`, }, "FOLDER": { - Description: `Select a folder of messages. Identical to the SELECT command. See help + Description: ` Select a folder of messages. Identical to the SELECT command. See help on that command for more information. Format: - SET FOLDER [folder-name] 3 /MARKED Selects messages that have been marked (indicated by an asterisk). @@ -1573,14 +1411,13 @@ to be reselected. `, }, "GENERIC": { - Description: `Specifies that the given account is a "generic" account, i.e used by + Description: ` Specifies that the given account is a "generic" account, i.e used by many different people. If an account is specified as GENERIC, new messages placed in the GENERAL folder will be displayed upon logging in for a specific number of days, rather than only once. The default period is 7 days. This command is a privileged command. Format: - SET [NO]GENERIC username NOTE: Both SET GENERIC and SET CONTINUOUS_BRIEF cannot be set for the @@ -1593,18 +1430,17 @@ for upon logging in. `, }, "KEYPAD": { - Description: `Controls whether the keypad has been enabled such that the keys on the + Description: ` Controls whether the keypad has been enabled such that the keys on the keypad correspond to command definitions. These definitions can be seen via the SHOW KEYPAD command. The default is NOKEYPAD unless the /KEYPAD qualifier has been added to the BULLETIN command line. Format: - SET [NO]KEYPAD `, }, "LOGIN": { - Description: `Controls whether the specified user will be alerted of any messages, + Description: ` Controls whether the specified user will be alerted of any messages, whether system or non-system, upon logging in. If an account has the DISMAIL flag set, SET NOLOGIN is automatically applied to that account during the first time that the account logs in. However, this will not @@ -1614,12 +1450,11 @@ above was to avoid extra overhead for constant checking for the DISMAIL flag.) This command is a privileged command. Format: - SET [NO]LOGIN username `, }, "NODE": { - Description: `Modifies the selected folder from a local folder to a remote folder. A + Description: ` Modifies the selected folder from a local folder to a remote folder. A remote folder is a folder in which the messages are actually stored on a folder at a remote DECNET node. The SET NODE command specifies the name of the remote node, and optionally the name of the remote folder. If @@ -1645,11 +1480,10 @@ If not specified, the selected folder is modified. `, }, "NOTIFY": { - Description: `Specifies whether you will be notified via a broadcast message when a + Description: ` Specifies whether you will be notified via a broadcast message when a message is added to the selected folder. Format: - SET [NO]NOTIFY In a cluster, if the logical name MAIL$SYSTEM_FLAGS is defined so that @@ -1676,7 +1510,7 @@ individual. /DEFAULT must be specified. This is a privileged qualifier. `, }, "PAGE": { - Description: `Specifies whether any directory listing or message reading output will + Description: ` Specifies whether any directory listing or message reading output will pause when it reaches the end of the page or not. Setting NOPAGE is useful for terminals that can store more than one screenful at a time, and that have a remote printer that can then print the contents of the @@ -1684,17 +1518,15 @@ terminal's memory. The default is PAGE, unless the default was changed by specifying /NOPAGE on the command line to invoke BULLETIN. Format: - SET [NO]PAGE `, }, "PRIVILEGES": { - Description: `Specifies either process privileges or rights identifiers that are + Description: ` Specifies either process privileges or rights identifiers that are necessary to use privileged commands. Use the SHOW PRIVILEGES command to see what is presently set. This is a privileged command. Format: - SET PRIVILEGES parameters The parameters are one or more privileges separated by commas. To @@ -1710,21 +1542,20 @@ privileged commands. If /NOID is specified, the identifier is removed. }, "PROMPT_EXPIRE": { Description: `Specifies that a user will be prompted for an expiration date when -adding a message. If NOPROMPT_EXPIRE is specified, the user will not be -prompted, and the default expiration (which is set by SET DEFAULT_EXPIRE -or SET BBOARD/EXPIRATION) will be used. If the value specified is -greater than the expiration limit, and the user does not have -privileges, then the expiration limit will be used as the default -expiration. (If there is no expiration limit, and the user doesn't have -privileges, then an error will result.) PROMPT_EXPIRE is the default. +adding a message. If NOPROMPT_EXPIRE is specified, the user will +not be prompted, and the default expiration (which is set by SET +DEFAULT_EXPIRE) will be used. If the value specified is greater than the +expiration limit, and the user does not have privileges, then the +expiration limit will be used as the default expiration. (If there is no +expiration limit, and the user doesn't have privileges, then an error +will result.) PROMPT_EXPIRE is the default. Format: - SET [NO]PROMPT_EXPIRE `, }, "READNEW": { - Description: `Controls whether you will be prompted upon logging in if you wish to + Description: ` Controls whether you will be prompted upon logging in if you wish to read new non-system or folder messages (if any exist). A new message is defined as one that has been added since the last login, or since accessing BULLETIN. The default setting for READNEW is dependent on how @@ -1734,7 +1565,6 @@ In order to apply this to a specific folder, first select the folder (using the SELECT command), and then enter the SET READNEW command. Format: - SET [NO]READNEW NOTE: If you have several folders with READNEW enabled, each folder's @@ -1768,7 +1598,7 @@ individual. This is a privileged qualifier. `, }, "SHOWNEW": { - Description: `Controls whether a directory listing of new messages for the current + Description: ` Controls whether a directory listing of new messages for the current folder will be displayed when logging in. This is similar to READNEW, except you will not be prompted to read the messages. The default is dependent on how the folder was created by the owner. A new message is @@ -1779,7 +1609,6 @@ In order to apply this to a specific folder, first select the folder (using the SELECT command), and then enter the SET SHOWNEW command. Format: - SET [NO]SHOWNEW 3 /ALL Specifies that the SET [NO]SHOWNEW option is the default for all users for @@ -1803,12 +1632,11 @@ individual, except if changing to READNEW. This is a privileged qualifier. `, }, "SYSTEM": { - Description: `Specifies that the selected folder is a SYSTEM folder. A SYSTEM folder + Description: ` Specifies that the selected folder is a SYSTEM folder. A SYSTEM folder is allowed to have SYSTEM and SHUTDOWN messages added to it. This is a privileged command. Format: - SET [NO]SYSTEM By default, the GENERAL folder is a SYSTEM folder, and the setting for @@ -1825,17 +1653,16 @@ folder at the other node is also a SYSTEM folder. `, Flags: dclish.Flags{ "FLAGS": { - Description: `Shows whether BRIEF, NOTIFY, READNEW, or SHOWNEW has been set for the + Description: ` Shows whether BRIEF, NOTIFY, READNEW, or SHOWNEW has been set for the currently selected folder. `, }, "FOLDER": { - Description: `Shows information about a folder of messages. Owner and description are + Description: ` Shows information about a folder of messages. Owner and description are shown. If the folder name is omitted, and a folder has been selected via the SELECT command, information about that folder is shown. Format: - SHOW FOLDER [folder-name] 3 /FULL Control whether all information of the folder is displayed. This @@ -1845,7 +1672,7 @@ have access to that folder. `, }, "KEYPAD": { - Description: `Displays the keypad command definitions. If the keypad has been enabled + Description: ` Displays the keypad command definitions. If the keypad has been enabled by either the SET KEYPAD COMMAND, or /KEYPAD is specified on the command line, the keypad keys will be defined as commands. SHOW KEYPAD is the equivalent of HELP KEYPAD. @@ -1856,20 +1683,20 @@ Prints the keypad definitions on the default printer (SYS$PRINT). `, }, "NEW": { - Description: `Shows folders which have new unread messages for which BRIEF or READNEW + Description: ` Shows folders which have new unread messages for which BRIEF or READNEW have been set. (Note: If you enter BULLETIN but do not read new unread messages, you will not be notified about them the next time you enter BULLETIN. This is a design "feature" and cannot easily be changed.) `, }, "PRIVILEGES": { - Description: `Shows the privileges necessary to use privileged commands. Also shows + Description: ` Shows the privileges necessary to use privileged commands. Also shows any rights identifiers that would also give a user privileges. (The latter are ACLs which are set on the BULLUSER.DAT file.) `, }, "USER": { - Description: `Shows the last time that a user logged in, or if /FOLDER is specified, + Description: ` Shows the last time that a user logged in, or if /FOLDER is specified, the latest message which a user has read in the folder. If NOLOGIN is set for a user, this information will be displayed. This is a privileged command. Non-privileged users will only be able to display @@ -1919,7 +1746,7 @@ valid for newsgroups. Use /SINCE for folders and with /LOGIN. `, }, "VERSION": { - Description: `Shows the version of BULLETIN and the date that the executable was + Description: ` Shows the version of BULLETIN and the date that the executable was linked. `, }, diff --git a/repl/help.go b/repl/help.go index 52a0a8cd95e7ce231ae1008aaabf6933ae3caf39..b1fd35b8cf5a36a0dae4495a8c13fa8304dbf5b5 100644 --- a/repl/help.go +++ b/repl/help.go @@ -18,17 +18,17 @@ automatic reading.) Messages are automatically deleted when their expiration date has passed.`, "FOLDERS": `All messages are divided into separate folders. The default folder is GENERAL. New folders can be created by any user. As an example, the -following creates a folder for GAMES related messages: - +following creates a folder for GAMES related messages: + BULLETIN> CREATE GAMES Enter a one line description of folder. GAMES - + To see the list of available folders, use DIRECTORY/FOLDERS. To select -a specific folder, use the SELECT command. - +a specific folder, use the SELECT command. + If a user selects a folder and enters the SET READNEW command, that -user will be alerted of topics of new messages at login time, and will +user will be alerted of topics of new messages at login time, and will then be given the option of reading them. Similar to READNEW is SHOWNEW, which displays the topics but doesn't prompt to read them. Even less is SET BRIEF, which will cause only a one line output indicating that there @@ -36,13 +36,13 @@ are new messages in the folder. There also is the SET NOTIFY option, which will cause a message to be broadcast to a user's terminal alerting the user that a new message has been added. Any of these options can be the default for the folder by using the /DEFAULT switch on the command. - -A folder can be restricted to only certain users, if desired. This is -done by specifying CREATE/PRIVATE. Afterwards, access to the folder is + +A folder can be restricted to only certain users, if desired. This is +done by specifying CREATE/PRIVATE. Afterwards, access to the folder is controlled by the creator by the SET [NO]ACCESS command. If /SEMIPRIVATE rather than /PRIVATE is specified, all users can read the messages in the folder, but only those give access can add messages. - + A folder can be converted into a remote folder using CREATE/NODE or SET NODE. A remote folder is one which points to a folder on a remote DECNET node. Messages added to a remote node are actually stored on the folder @@ -59,7 +59,7 @@ use is to create a folder for posting SYSTEM messages only meant for a certain UIC group. This is done by creating a PRIVATE SYSTEM folder, and giving access to that UIC group. Only users in that UIC group will see the messages in that folder when they log in.`, - "CTRL-C": `Except for when BULLETIN is awaiting input from the terminal, a + "CTRL-C": `Except for when BULLETIN is awaiting input from the terminal, a CTRL-C will cause BULLETIN to abort the execution of any command. If BULLETIN is waiting for terminal input, a CTRL-C will cause BULLETIN to return to the BULLETIN> prompt. If for some reason the user wishes @@ -68,6 +68,27 @@ always true, as BULLETIN will ignore the CTRL-Y if it has a data file opened at the time. (Otherwise it would be possible to put the files in a state such that they would be inaccessible by other users.) `, + "KEYPAD": ` +--------+--------+--------+--------+ + | PF1 | PF2 | PF3 | PF4 | + | GOLD | HELP | EXTRACT|SHOW KEY| + | |ST NOKEY| FILE |SH KY/PR| + |--------|--------|--------|--------| + | 7 | 8 | 9 | -- | + | ADD | REPLY | MAIL |READ/NEW| + | ADD/EDI|RP/ED/EX|M/NOHEAD|SHOW NEW| + |--------|--------|--------|--------| + | 4 | 5 | 6 | , | + | CURRENT| RESPOND| LAST | DIR/NEW| + |CURR/EDI|RS/ED/EX| | INDEX | + |--------|--------|--------|--------| + | 1 | 2 | 3 |ENTER | + | BACK | PRINT | DIR | | + | NEXT |P/NONOTI|DIR/FOLD| | + |--------+--------|--------| ENTER | + | 0 | . | SELECT | + | SHOW FOLDER/FULL| DELETE | | + | SHOW FLAGS | UNDELE | | + +-----------------+--------+--------+`, } func init() { @@ -84,7 +105,11 @@ func init() { } sort.Strings(flgs) for i := range flgs { - fmt.Fprintf(buf, "\n\n%s %s", flgs[i], commands[c].Flags[flgs[i]].Description) + if strings.HasPrefix(commands[c].Flags[flgs[i]].Description, "/") { + fmt.Fprintf(buf, "\n\n%s", commands[c].Flags[flgs[i]].Description) + } else { + fmt.Fprintf(buf, "\n\n%s\n\n%s", flgs[i], commands[c].Flags[flgs[i]].Description) + } } } helpmap[c] = buf.String() @@ -105,33 +130,33 @@ func init() { buf.Reset() linelen := 2 - fmt.Fprint(buf, `The following command and topics are available for more help - - `) + fmt.Fprint(buf, + "\n\nThe following commands and topics are available for more help\n\n ") + pretty := map[string]string{ + "FOLDERS": "Folders", + "CTRL-C": "Ctrl-C", + "KEYPAD": "Keypad", + } for i := range topics { linelen += maxlen if linelen > 78 { fmt.Fprint(buf, "\n ") linelen = maxlen + 2 } - // TODO: Kludge - move helpmap to map[string]TopicType which has a - // description and a display name. - switch topics[i] { - case "FOLDERS": - fmt.Fprintf(buf, "%-*s", maxlen, "Folders") - case "CTRL-C": - fmt.Fprintf(buf, "%-*s", maxlen, "Ctrl-C") - default: - fmt.Fprintf(buf, "%-*s", maxlen, topics[i]) + topic := pretty[topics[i]] + if topic == "" { + topic = topics[i] } + fmt.Fprintf(buf, "%-*s", maxlen, topic) } - helpmap["TOPICS"] = buf.String() + fmt.Fprint(buf, "\n") + helpmap["HELP"] += buf.String() } // ActionHelp handles the `HELP` command. func ActionHelp(cmd *dclish.Command) error { if len(cmd.Args) == 0 { - fmt.Printf("%s\n", cmd.Description) + fmt.Printf("%s\n", helpmap["HELP"]) return nil } wordup := strings.ToUpper(cmd.Args[0]) diff --git a/repl/messages.go b/repl/messages.go index 4dfe87e52b6dd408ee56b79229941f32b6d59318..507b091028bae05269690a4502b627ba74d0e751 100644 --- a/repl/messages.go +++ b/repl/messages.go @@ -2,8 +2,11 @@ package repl import ( + "errors" "fmt" + "strconv" "strings" + "time" "git.lyda.ie/kevin/bulletin/accounts" "git.lyda.ie/kevin/bulletin/dclish" @@ -29,7 +32,7 @@ func ActionAdd(cmd *dclish.Command) error { optBell := 0 optBroadcast := 0 optEdit := 0 - optExpiration := 0 + optExpiration := &time.Time{} optExtract := 0 optFolder := []string{} optIndent := 0 @@ -51,8 +54,19 @@ func ActionAdd(cmd *dclish.Command) error { if cmd.Flags["/EDIT"].Value == "true" { optEdit = 1 } - if cmd.Flags["/EXPIRATION"].Value == "true" { - optExpiration = 1 + if cmd.Flags["/EXPIRATION"].Value != "" { + // dd-mmm-yyyy, or delta time: dddd + exp, err := time.Parse("2006-01-02", cmd.Flags["/EXPIRATION"].Value) + if err != nil { + days, err := strconv.Atoi(cmd.Flags["/EXPIRATION"].Value) + if err != nil { + optExpiration = nil + } + exp := time.Now().AddDate(0, 0, days) + optExpiration = &exp + } else { + optExpiration = &exp + } } if cmd.Flags["/EXTRACT"].Value == "true" { optExtract = 1 @@ -80,17 +94,82 @@ func ActionAdd(cmd *dclish.Command) error { optSystem = 1 } - todoRemove := optAll + optBell + optBroadcast + optEdit + optExpiration + optExtract + optIndent + optPermanent + optShutdown + optSignature + optSystem + fmt.Printf("TODO: optAll is not yet implemented - you set it to %d\n", optAll) + fmt.Printf("TODO: optBell is not yet implemented - you set it to %d\n", optBell) + fmt.Printf("TODO: optBroadcast is not yet implemented - you set it to %d\n", optBroadcast) + fmt.Printf("TODO: optEdit is not yet implemented - you set it to %d\n", optEdit) + fmt.Printf("TODO: optExtract is not yet implemented - you set it to %d\n", optExtract) + fmt.Printf("TODO: optIndent is not yet implemented - you set it to %d\n", optIndent) + fmt.Printf("TODO: optSignature is not yet implemented - you set it to %d\n", optSignature) + fmt.Printf("TODO: optSystem is not yet implemented - you set it to %d\n", optSystem) + if len(optFolder) == 0 { optFolder = []string{accounts.User.CurrentFolder} } // TODO: check if folders exist. - // TODO: prompt for subject if optSubject == "" + if optSubject == "" { + optSubject, _ = accounts.GetLine("Enter subject of message: ") + if optSubject == "" { + return errors.New("Must enter a subject") + } + } + // TODO: check we have permission for shutdown and permanent message, err := editor.Editor(fmt.Sprintf("Enter message for '%s'...", optSubject), "Edit message") if err != nil { return err } - fmt.Printf("TODO: The message you entered %d...\n%s\n...will be posted to %s.\n", todoRemove, message, strings.Join(optFolder, ", ")) + for i := range optFolder { + err = accounts.User.Folders.CreateMessage(accounts.User.Login, optSubject, message, + optFolder[i], optPermanent, optShutdown, optExpiration) + } + return nil +} + +// ActionCurrent handles the `CURRENT` command. +func ActionCurrent(cmd *dclish.Command) error { + fmt.Printf("TODO: unimplemented...\n%s\n", cmd.Description) + return nil +} + +// ActionBack handles the `BACK` command. +func ActionBack(cmd *dclish.Command) error { + fmt.Printf("TODO: unimplemented...\n%s\n", cmd.Description) + return nil +} + +// ActionChange handles the `CHANGE` command. +func ActionChange(cmd *dclish.Command) error { + fmt.Printf("TODO: unimplemented...\n%s\n", cmd.Description) + return nil +} + +// ActionFirst handles the `FIRST` command. +func ActionFirst(cmd *dclish.Command) error { + fmt.Printf("TODO: unimplemented...\n%s\n", cmd.Description) + return nil +} + +// ActionNext handles the `NEXT` command. +func ActionNext(cmd *dclish.Command) error { + fmt.Printf("TODO: unimplemented...\n%s\n", cmd.Description) + return nil +} + +// ActionRead handles the `READ` command. +func ActionRead(cmd *dclish.Command) error { + fmt.Printf("TODO: unimplemented...\n%s\n", cmd.Description) + return nil +} + +// ActionReply handles the `REPLY` command. +func ActionReply(cmd *dclish.Command) error { + fmt.Printf("TODO: unimplemented...\n%s\n", cmd.Description) + return nil +} + +// ActionForward handles the `FORWARD` command. +func ActionForward(cmd *dclish.Command) error { + fmt.Printf("TODO: unimplemented...\n%s\n", cmd.Description) return nil }