diff --git a/dclish/dclish.go b/dclish/dclish.go
index 6849830f4e04e2bcdf0bfe9d3e37d0190dce626e..74f03a1aa93a76439b0d29e3aa91cf42ff6443f3 100644
--- a/dclish/dclish.go
+++ b/dclish/dclish.go
@@ -35,7 +35,6 @@ type Commands map[string]*Command
func (c Commands) ParseAndRun(line string) error {
// TODO: this doesn't handle a DCL command line completely.
words := strings.Fields(line)
- fmt.Printf("TODO ParseAndRun need to parse flags: %s\n", words)
cmd, ok := c[strings.ToUpper(words[0])]
if !ok {
fmt.Printf("ERROR: Unknown command '%s'\n", words[0])
@@ -52,6 +51,7 @@ func (c Commands) ParseAndRun(line string) error {
if len(words) == 1 {
return cmd.Action(cmd)
}
+ // TODO: need to clean this up.
for i := range words[1:] {
if strings.HasPrefix(words[i], "/") {
flag, val, assigned := strings.Cut(words[i], "=")
@@ -63,7 +63,6 @@ func (c Commands) ParseAndRun(line string) error {
}
flg.Value = val
} else {
- // TODO: handle toggle flag.
wordup := strings.ToUpper(words[i])
value := "true"
if strings.HasPrefix(wordup, "/NO") {
@@ -76,6 +75,8 @@ func (c Commands) ParseAndRun(line string) error {
}
flg.Value = value
}
+ } else {
+ cmd.Args = append(cmd.Args, words[i])
}
}
return cmd.Action(cmd)
diff --git a/repl/command.go b/repl/command.go
index e1297eaf43f98193c07efcb1aee107eeec20dd70..3bd1bd14110300319b91bbd772db68b0352150a0 100644
--- a/repl/command.go
+++ b/repl/command.go
@@ -4,8 +4,7 @@ package repl
import "git.lyda.ie/kevin/bulletin/dclish"
var commands = dclish.Commands{
- {
- Command: "ADD",
+ "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
@@ -15,22 +14,19 @@ topic of the message.
ADD [file-name]
`,
Flags: dclish.Flags{
- {
- Name: "/ALL",
+ "/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.
`,
},
- {
- Name: "/BELL",
+ "/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.
`,
},
- {
- Name: "/BROADCAST",
+ "/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
@@ -41,24 +37,21 @@ broadcasted to it, (even though it is able to create a remote folder).
See also /ALL and /BELL.
`,
},
- {
- Name: "/CLUSTER",
+ "/CLUSTER": {
Description: `/[NO]CLUSTER
This option specifies that broadcasted messages should be sent to all
nodes in the cluster. /CLUSTER is the default.
`,
},
- {
- Name: "/EDIT",
+ "/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.
`,
},
- {
- Name: "/EXPIRATION",
+ "/EXPIRATION": {
Description: `/EXPIRATION=time
Specifies the time at which the message is to expire. Either absolute
@@ -66,8 +59,7 @@ time: [dd-mmm-yyyy] hh:mm:ss, or delta time: dddd [hh:mm:ss] can be
used.
`,
},
- {
- Name: "/EXTRACT",
+ "/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
@@ -75,8 +67,7 @@ text is indented with > at the beginning of each line. This can be
suppressed with /NOINDENT.
`,
},
- {
- Name: "/FOLDER",
+ "/FOLDER": {
Description: `/FOLDER=(foldername,[...])
Specifies the foldername into which the message is to be added. Does
@@ -100,14 +91,12 @@ if privileged options are allowed. If they are not allowed, the message
will still be added, but without the privileged settings.
`,
},
- {
- Name: "/LOCAL",
+ "/LOCAL": {
Description: `Specifies that when /BROADCAST is specified for a remote folder, the
message is broadcasted ONLY on the local node.
`,
},
- {
- Name: "/NODES",
+ "/NODES": {
Description: `/NODES=(nodes[,...])
Specifies to send the message to the listed DECNET nodes. The BULLETIN
@@ -126,34 +115,29 @@ NOTE: It is preferable to use /FOLDER instead of /NODE if possible,
since adding messages via /FOLDER is much quicker.
`,
},
- {
- Name: "/NOINDENT",
+ "/NOINDENT": {
Description: `See /EXTRACT for information on this qualifier.
`,
},
- {
- Name: "/NOSIGNATURE",
+ "/NOSIGNATURE": {
Description: `Specifies to suppress the 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.
`,
},
- {
- Name: "/PERMANENT",
+ "/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.
`,
},
- {
- Name: "/SUBJECT",
+ "/SUBJECT": {
Description: `/SUBJECT=description
Specifies the subject of the message to be added.
`,
},
- {
- Name: "/SHUTDOWN",
+ "/SHUTDOWN": {
Description: `/SHUTDOWN[=nodename]
This option is restricted to privileged users. If specified, message
will be automatically deleted after a computer shutdown has occurred.
@@ -169,8 +153,7 @@ after the remote node reboots, not the node from which the message was
added. The nodename cannot be specified with a remote folder.
`,
},
- {
- Name: "/SYSTEM",
+ "/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
@@ -178,16 +161,14 @@ avoid the possibility that system messages could scroll off the screen.
This option is restricted to SYSTEM folders.
`,
},
- {
- Name: "/USERNAME",
+ "/USERNAME": {
Description: `Specifies username to be used at remote DECNET nodes when adding messages
to DECNET nodes via the /NODE qualifier.
`,
},
},
},
- {
- Command: "ATTACH",
+ "ATTACH": {
Description: `Permits you to switch control of your terminal from your current
process to another process in your job.
@@ -203,8 +184,7 @@ to get back to the BULLETN subprocess you already created.
ATTACH [/PARENT] [process-name]
`,
Flags: dclish.Flags{
- {
- Name: "Parameters",
+ "Parameters": {
Description: `process-name
Indicates the name of the subprocess to which the connection is to
@@ -212,8 +192,7 @@ to get back to the BULLETN subprocess you already created.
`,
},
- {
- Name: "Qualifiers",
+ "Qualifiers": {
Description: `/PARENT
Allows you to attach to your process' parent process.
@@ -222,8 +201,7 @@ to get back to the BULLETN subprocess you already created.
`,
},
- {
- Name: "Examples",
+ "Examples": {
Description: ` 1.
$ SPAWN BULLETIN
%DCL-S-SPAWNED, process MAGNANI_3 spawned
@@ -247,19 +225,16 @@ to get back to the BULLETN subprocess you already created.
},
},
},
- {
- Command: "BACK",
+ "BACK": {
Description: `Displays the message preceding the current message.
`,
Flags: dclish.Flags{
- {
- Name: "/EDIT",
+ "/EDIT": {
Description: `Specifies that the editor is to be used to read the message. This is
useful for scanning a long message.
`,
},
- {
- Name: "/HEADER",
+ "/HEADER": {
Description: `/[NO]HEADER
Specifies that if a message header exists, the header will be shown.
@@ -271,8 +246,7 @@ is set for the folder, it will change the default to be /HEADER.
},
},
},
- {
- Command: "BULLETIN",
+ "BULLETIN": {
Description: `The BULLETIN utility permits a user to create a message for reading by
all users. Users are notified upon logging in that new messages have
been added, and what the topic of the messages are. Actual reading of
@@ -281,8 +255,7 @@ automatic reading.) Messages are automatically deleted when their
expiration date has passed.
`,
},
- {
- Command: "CHANGE",
+ "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
@@ -297,14 +270,12 @@ by the qualifier /NEW.
CHANGE [file-name]
`,
Flags: dclish.Flags{
- {
- Name: "/ALL",
+ "/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.
`,
},
- {
- Name: "/EDIT",
+ "/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
@@ -312,8 +283,7 @@ a file-name or /NEW is specified. /EDIT is the default if you have
added /EDIT to your BULLETIN command line.
`,
},
- {
- Name: "/EXPIRATION",
+ "/EXPIRATION": {
Description: `/EXPIRATION[=time]
Specifies the time at which the message is to expire. Either absolute
@@ -321,27 +291,23 @@ 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.
`,
},
- {
- Name: "/GENERAL",
+ "/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.
`,
},
- {
- Name: "/HEADER",
+ "/HEADER": {
Description: `Specifies that the message header is to be replaced. You will be
prompted for the new message description.
`,
},
- {
- Name: "/NEW",
+ "/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.
`,
},
- {
- Name: "/NUMBER",
+ "/NUMBER": {
Description: `/NUMBER=message_number[-message_number1]
Specifies the message or messages to be replaced. If this qualifier is
@@ -353,39 +319,33 @@ 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.
`,
},
- {
- Name: "/PERMANENT",
+ "/PERMANENT": {
Description: `Specifies that the message is to be made permanent.
`,
},
- {
- Name: "/SHUTDOWN[=nodename]",
+ "/SHUTDOWN[=nodename]": {
Description: `Specifies that the message is to expire after the next computer
shutdown. This option is restricted to SYSTEM folders.
`,
},
- {
- Name: "/SUBJECT",
+ "/SUBJECT": {
Description: `/SUBJECT=description
Specifies the subject of the message to be added.
`,
},
- {
- Name: "/SYSTEM",
+ "/SYSTEM": {
Description: `Specifies that the message is to be made a SYSTEM message. This is a
privileged command and is restricted to SYSTEM folders.
`,
},
- {
- Name: "/TEXT",
+ "/TEXT": {
Description: `Specifies that the message text is to be replaced.
`,
},
},
},
- {
- Command: "COPY",
+ "COPY": {
Description: `Copies a message to another folder without deleting it from the
current folder.
@@ -401,21 +361,18 @@ 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.
`,
Flags: dclish.Flags{
- {
- Name: "/ALL",
+ "/ALL": {
Description: `Specifies to copy all the messages in the old folder.
`,
},
- {
- Name: "/GROUPS",
+ "/GROUPS": {
Description: `/GROUPS=(newsgroup,[...])
Valid only if a NEWS group is selected. Specifies to send the message to
the specified NEWS group(s) in addition to the selected NEWS group.
`,
},
- {
- Name: "/HEADER",
+ "/HEADER": {
Description: `/[NO]HEADER
Valid only if destination folder is a news group. Specifies that header
@@ -423,15 +380,13 @@ of message is to be included with the text when the text is copied.
The default is /NOHEADER.
`,
},
- {
- Name: "/MERGE",
+ "/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.
`,
},
- {
- Name: "/ORIGINAL",
+ "/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.
@@ -439,8 +394,7 @@ the person copying the message.
},
},
},
- {
- Command: "CREATE",
+ "CREATE": {
Description: `Creates a folder of messages. This is similar to the folders in the VMS
MAIL utility. Folders are often created so that messages of a similar
topic are grouped separately, or to restrict reading of certain messages
@@ -461,8 +415,7 @@ has elected to install it as such. This is done by modifying
BULLCOM.CLD.
`,
Flags: dclish.Flags{
- {
- Name: "/ALWAYS",
+ "/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
@@ -473,15 +426,13 @@ meant for messages which are very important, and thus you want to make
sure they are read.
`,
},
- {
- Name: "/BRIEF",
+ "/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.)
`,
},
- {
- Name: "/DESCRIPTION",
+ "/DESCRIPTION": {
Description: `/DESCRIPTION=description
Specifies the description of the folder, which is displayed using the
@@ -506,8 +457,7 @@ IN%. If desired, you can specify the protocol with the address, i.e.
INFOVAX MAILING LIST <IN%"INFO-VAX@KL.SRI.COM">
`,
},
- {
- Name: "/ID",
+ "/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
@@ -517,8 +467,7 @@ 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.
`,
},
- {
- Name: "/NODE",
+ "/NODE": {
Description: `/NODE=node
Specifies that the folder is a remote folder at the specified node.
@@ -546,22 +495,19 @@ of the message. However, if the message is added with /BROADCAST, the
message will be broadcasted immediately to all nodes.
`,
},
- {
- Name: "/NOTIFY",
+ "/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.)
`,
},
- {
- Name: "/OWNER",
+ "/OWNER": {
Description: `/OWNER=username
Specifies the owner of the folder. This is a privileged command.
See also /ID.
`,
},
- {
- Name: "/PRIVATE",
+ "/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.
@@ -571,36 +517,31 @@ enter the user into it (unless this feature was disabled during the
compilation of this program). NOTE: See HELP SET ACCESS for more info.
`,
},
- {
- Name: "/READNEW",
+ "/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.)
`,
},
- {
- Name: "/REMOTENAME",
+ "/REMOTENAME": {
Description: `/REMOTENAME=foldername
Valid only if /NODE is present, i.e. that the folder is a remote folder.
Specifies the name of the remote folder name. If not specified, it is
assumed that the remote name is the same as the local name.
`,
},
- {
- Name: "/SHOWNEW",
+ "/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.)
`,
},
- {
- Name: "/SEMIPRIVATE",
+ "/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.
`,
},
- {
- Name: "/SYSTEM",
+ "/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.
@@ -611,8 +552,7 @@ folder at the other node is also a SYSTEM folder.
},
},
},
- {
- Command: "Ctrl-C",
+ "Ctrl-C": {
Description: `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
@@ -623,8 +563,7 @@ 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.)
`,
},
- {
- Command: "CURRENT",
+ "CURRENT": {
Description: `Displays the beginning of the message you are currently reading. If
you are reading a long message and want to display the first part
of the message again, you can enter the CURRENT command.
@@ -634,14 +573,12 @@ of the message again, you can enter the CURRENT command.
CURRENT
`,
Flags: dclish.Flags{
- {
- Name: "/EDIT",
+ "/EDIT": {
Description: `Specifies that the editor is to be used to read the message. This is
useful for scanning a long message.
`,
},
- {
- Name: "/HEADER",
+ "/HEADER": {
Description: `/[NO]HEADER
Specifies that if a message header exists, the header will be shown.
@@ -653,8 +590,7 @@ is set for the folder, it will change the default to be /HEADER.
},
},
},
- {
- Command: "DELETE",
+ "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
@@ -674,20 +610,17 @@ 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.
`,
Flags: dclish.Flags{
- {
- Name: "/ALL",
+ "/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.
`,
},
- {
- Name: "/IMMEDIATE",
+ "/IMMEDIATE": {
Description: `Specifies that the message is to be deleted immediately.
`,
},
- {
- Name: "/NODES",
+ "/NODES": {
Description: `/NODES=(nodes[,...])
Specifies to delete the message at the listed DECNET nodes. The BULLETIN
@@ -704,8 +637,7 @@ more node names. I.e. $ DEFINE ALL_NODES "VAX1,VAX2,VAX3", and then
specify /NODES=ALL_NODES. Note that the quotation marks are required.
`,
},
- {
- Name: "/SUBJECT",
+ "/SUBJECT": {
Description: `/SUBJECT=subject
Specifies the subject of the bulletin to be deleted at a remote DECNET
@@ -716,16 +648,14 @@ the exact subject that was specified. Case is not critical either.
You will be notified if the deletion was successful.
`,
},
- {
- Name: "/USERNAME",
+ "/USERNAME": {
Description: `Specifies username to be used at remote DECNET nodes when deleting messages
on other DECNET nodes via the /NODE qualifier.
`,
},
},
},
- {
- Command: "DIRECTORY",
+ "DIRECTORY": {
Description: `Lists a summary of the messages. The message number, submitter's name,
date, and subject of each message is displayed.
@@ -740,48 +670,41 @@ first message, or if a message has already been read, it will start at
that message.
`,
Flags: dclish.Flags{
- {
- Name: "/ALL",
+ "/ALL": {
Description: `Lists all messages. Used if the qualifiers /MARKED, /UNMARKED, /SEEN,
or /UNSEEN were previously specified.
`,
},
- {
- Name: "/DESCRIBE ",
+ "/DESCRIBE ": {
Description: `Valid when used with /FOLDERS. Specifies to include description of
folder.
`,
},
- {
- Name: "/EXPIRATION",
+ "/EXPIRATION": {
Description: `Shows the message's expiration date rather than the creation date.
`,
},
- {
- Name: "/END",
+ "/END": {
Description: `/END=message_number
Indicates the last message number you want to display.
`,
},
- {
- Name: "/FOLDERS",
+ "/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. This will not show
newsgroups. To see newsgroups, use the NEWS command or DIR/NEWS.
`,
},
- {
- Name: "/MARKED",
+ "/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.
`,
},
- {
- Name: "/UNMARKED",
+ "/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
@@ -789,36 +712,31 @@ to be read. To see all messages, use either /ALL, or reselect the
folder.
`,
},
- {
- Name: "/SEEN",
+ "/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.
`,
},
- {
- Name: "/UNSEEN",
+ "/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.
`,
},
- {
- Name: "/NEW",
+ "/NEW": {
Description: `Specifies to start the listing of messages with the first unread
message.
`,
},
- {
- Name: "/NEWS",
+ "/NEWS": {
Description: `Lists the available news groups. This does the same thing as the NEWS
command. See that command for qualifiers which apply.
`,
},
- {
- Name: "/PRINT",
+ "/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
@@ -826,14 +744,12 @@ of messages to be printed will be displayed on the terminal (in
nopaging format).
`,
},
- {
- Name: "/REPLY",
+ "/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.
`,
},
- {
- Name: "/SEARCH",
+ "/SEARCH": {
Description: `/SEARCH=[string]
Specifies that only messages which contain the specified string are
@@ -841,16 +757,14 @@ to be displayed. This cannot be used in conjunction with /MARKED.
If no string is specified, the previously specified string is used.
`,
},
- {
- Name: "/SINCE",
+ "/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.
`,
},
- {
- Name: "/START",
+ "/START": {
Description: `/START=message_number
Indicates the first message number you want to display. For example,
@@ -858,8 +772,7 @@ to display all the messages beginning with number three, enter the
command line DIRECTORY/START=3. Not valid with /FOLDER.
`,
},
- {
- Name: "/SUBJECT",
+ "/SUBJECT": {
Description: `/SUBJECT=[string]
Specifies that only messages which contain the specified string in it's
@@ -870,19 +783,16 @@ is used.
},
},
},
- {
- Command: "EXIT",
+ "EXIT": {
Description: `Exits the BULLETIN program.
`,
Action: ActionExit,
},
- {
- Command: "EXTRACT",
+ "EXTRACT": {
Description: `Synonym for FILE command.
`,
},
- {
- Command: "FILE",
+ "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.
@@ -897,44 +807,37 @@ 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.
`,
Flags: dclish.Flags{
- {
- Name: "/ALL",
+ "/ALL": {
Description: `Copies all the messages in the current folder.
`,
},
- {
- Name: "/FF",
+ "/FF": {
Description: `Specifies that a form feed is placed between messages in the file.
`,
},
- {
- Name: "/HEADER",
+ "/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.
`,
},
- {
- Name: "/NEW",
+ "/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.
`,
},
},
},
- {
- Command: "FIRST",
+ "FIRST": {
Description: `Specifies that the first message in the folder is to be read.
`,
},
- {
- Command: "FORWARD",
+ "FORWARD": {
Description: `Synonym for MAIL command.
`,
},
- {
- Command: "Folders",
+ "Folders": {
Description: `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:
@@ -980,15 +883,14 @@ giving access to that UIC group. Only users in that UIC group will see
the messages in that folder when they log in.
`,
},
- {
- Command: "HELP",
+ "HELP": {
Description: `To obtain help on any topic, type:
HELP topic
`,
+ Action: ActionHelp,
},
- {
- Command: "INDEX",
+ "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
@@ -999,59 +901,51 @@ off after one has read a message.
INDEX
`,
Flags: dclish.Flags{
- {
- Name: "/MARKED",
+ "/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.
`,
},
- {
- Name: "/UNMARKED",
+ "/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.
`,
},
- {
- Name: "/SEEN",
+ "/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.
`,
},
- {
- Name: "/UNSEEN",
+ "/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.
`,
},
- {
- Name: "/NEW",
+ "/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.
`,
},
- {
- Name: "/RESTART",
+ "/RESTART": {
Description: `If specified, causes the listing to be reinitialized and start from the
first folder.
`,
},
- {
- Name: "/SUBSCRIBE",
+ "/SUBSCRIBE": {
Description: `If specified, lists only those news folders which have been subscribed to.
`,
},
},
},
- {
- Command: "KEYPAD",
+ "KEYPAD": {
Description: `+--------+--------+--------+--------+
| PF1 | PF2 | PF3 | PF4 |
| GOLD | HELP | EXTRACT|SHOW KEY|
@@ -1075,22 +969,19 @@ first folder.
+-----------------+--------+--------+
`,
},
- {
- Command: "LAST",
+ "LAST": {
Description: `Displays the last message in the current folder.
Format:
LAST
`,
Flags: dclish.Flags{
- {
- Name: "/EDIT",
+ "/EDIT": {
Description: `Specifies that the editor is to be used to read the message. This is
useful for scanning a long message.
`,
},
- {
- Name: "/HEADER",
+ "/HEADER": {
Description: `/[NO]HEADER
Specifies that if a message header exists, the header will be shown.
@@ -1102,8 +993,7 @@ is set for the folder, it will change the default to be /HEADER.
},
},
},
- {
- Command: "MAIL",
+ "MAIL": {
Description: `Invokes the VAX/VMS Personal Mail Utility (MAIL) to send the message
which you are reading to the specified recipients.
@@ -1118,22 +1008,19 @@ triple quotes. I.e. a network address of the form xxx%"address" must
be specified as xxx%"""address""".
`,
Flags: dclish.Flags{
- {
- Name: "/EDIT",
+ "/EDIT": {
Description: `Specifies that the editor is to be used to edit the message before
mailing it.
`,
},
- {
- Name: "/HEADER",
+ "/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.
`,
},
- {
- Name: "/SUBJECT",
+ "/SUBJECT": {
Description: `/SUBJECT=text
Specifies the subject of the mail message. If the text consists of more
@@ -1145,8 +1032,7 @@ as the subject.
},
},
},
- {
- Command: "MARK",
+ "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
@@ -1165,8 +1051,7 @@ the logical name BULL_MARK. If BULL_MARK is not defined, SYS$LOGIN
will be used.
`,
},
- {
- Command: "MODIFY",
+ "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.
@@ -1175,8 +1060,7 @@ owner of the folder or a user with privileges can use this command.
MODIFY
`,
Flags: dclish.Flags{
- {
- Name: "/DESCRIPTION",
+ "/DESCRIPTION": {
Description: `Specifies a new description for the folder. You will be prompted for
the text of the description.
@@ -1189,8 +1073,7 @@ placing it at the end of the description, i.e.
INFOVAX MAILING LIST <IN%"INFO-VAX@KL.SRI.COM">
`,
},
- {
- Name: "/ID",
+ "/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
@@ -1200,15 +1083,13 @@ 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.
`,
},
- {
- Name: "/NAME",
+ "/NAME": {
Description: `/NAME=foldername
Specifies a new name for the folder.
`,
},
- {
- Name: "/OWNER",
+ "/OWNER": {
Description: `/OWNER=username
Specifies a new owner for the folder. If the owner does not have
@@ -1218,8 +1099,7 @@ account in order to okay the modification. See also /ID.
},
},
},
- {
- Command: "MOVE",
+ "MOVE": {
Description: `Moves a message to another folder and deletes it from the current
folder.
@@ -1237,23 +1117,20 @@ 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.
`,
Flags: dclish.Flags{
- {
- Name: "/ALL",
+ "/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.
`,
},
- {
- Name: "/GROUPS",
+ "/GROUPS": {
Description: `/GROUPS=(newsgroup,[...])
Valid only if a NEWS group is selected. Specifies to send the message to
the specified NEWS group(s) in addition to the selected NEWS group.
`,
},
- {
- Name: "/HEADER",
+ "/HEADER": {
Description: `/[NO]HEADER
Valid only if destination folder is a news group. Specifies that header
@@ -1261,15 +1138,13 @@ of message is to be included with the text when the text is copied.
The default is /NOHEADER.
`,
},
- {
- Name: "/MERGE",
+ "/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.
`,
},
- {
- Name: "/ORIGINAL",
+ "/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.
@@ -1277,8 +1152,7 @@ the person moving the message.
},
},
},
- {
- Command: "NEWS",
+ "NEWS": {
Description: `Displays the list of available news groups.
Format:
@@ -1298,16 +1172,14 @@ has been renamed. The new name is shown on the display line immediately
following the old name.
`,
Flags: dclish.Flags{
- {
- Name: "/NEWGROUP",
+ "/NEWGROUP": {
Description: `If specified, will list new news groups that have been added since the
last time that a user has accessed a news group. If there are new
groups, a user will see a message indicating that there are new groups
when the user accesses a news group.
`,
},
- {
- Name: "/START",
+ "/START": {
Description: `/START=string
If specified, the list will start with the first group which follows
@@ -1315,8 +1187,7 @@ alphabetically after that string. I.e. if /START=B is specified, the
list will start with groups whose name starts with a B.
`,
},
- {
- Name: "/SUBSCRIBE",
+ "/SUBSCRIBE": {
Description: `If specified, lists only those news folders which have been subscribed to.
An asterisk before the group indicates that new messages are present for
that folder.
@@ -1324,21 +1195,18 @@ that folder.
},
},
},
- {
- Command: "NEXT",
+ "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.
`,
Flags: dclish.Flags{
- {
- Name: "/EDIT",
+ "/EDIT": {
Description: `Specifies that the editor is to be used to read the message. This is
useful for scanning a long message.
`,
},
- {
- Name: "/HEADER",
+ "/HEADER": {
Description: `/[NO]HEADER
Specifies that if a message header exists, the header will be shown.
@@ -1350,8 +1218,7 @@ is set for the folder, it will change the default to be /HEADER.
},
},
},
- {
- Command: "POST",
+ "POST": {
Description: `If a NEWS group is selected, posts a message to that group. If a normal
folder is selected, sends a message via MAIL to the network mailing list
which is associated with the selected folder. The address of the
@@ -1362,47 +1229,40 @@ MODIFY/DESCRIPTION. See help on those commands for more information.
POST [file-name]
`,
Flags: dclish.Flags{
- {
- Name: "/CC",
+ "/CC": {
Description: `/CC=user[s]
Specifies additional users that should receive the mail message.
`,
},
- {
- Name: "/EDIT",
+ "/EDIT": {
Description: `Specifies that the editor is to be used for creating the mail message.
`,
},
- {
- Name: "/EXTRACT",
+ "/EXTRACT": {
Description: `Specifies that the text of the message that is being read should be
included in the 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.
`,
},
- {
- Name: "/GROUPS",
+ "/GROUPS": {
Description: `/GROUPS=(newsgroup,[...])
Valid only if a NEWS group is selected. Specifies to send the message to
the specified NEWS group(s) in addition to the selected NEWS group.
`,
},
- {
- Name: "/NOINDENT",
+ "/NOINDENT": {
Description: `See /EXTRACT for information on this qualifier.
`,
},
- {
- Name: "/NOSIGNATURE",
+ "/NOSIGNATURE": {
Description: `Specifies to suppress the 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.
`,
},
- {
- Name: "/SUBJECT",
+ "/SUBJECT": {
Description: `/SUBJECT=text
Specifies the subject of the mail message. If the text consists of more
@@ -1411,8 +1271,7 @@ than one word, enclose the text in quotation marks (").
If you omit this qualifier, you will prompted for the subject.
`,
},
- {
- Name: "Signature_file",
+ "Signature_file": {
Description: `It is possibly to have the contents of a file be automatically appended
to the end of a message added with the POST and/or the RESPOND command.
This file is known as a signature file, and it typically contains one's
@@ -1440,8 +1299,7 @@ the message and the contents of the signature file.
},
},
},
- {
- Command: "PRINT",
+ "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
@@ -1464,13 +1322,11 @@ 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.
`,
Flags: dclish.Flags{
- {
- Name: "/ALL",
+ "/ALL": {
Description: `Prints all the messages in the current folder.
`,
},
- {
- Name: "/FORM",
+ "/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
@@ -1485,16 +1341,14 @@ physically change the paper stock on the output device, and restart the
queue specifying the new form type as the mounted form.)
`,
},
- {
- Name: "/HEADER",
+ "/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.
`,
},
- {
- Name: "/NOTIFY",
+ "/NOTIFY": {
Description: `/[NO]NOTIFY
Indicates that you will be notified by a broadcast message when the
@@ -1502,14 +1356,12 @@ file or files have been printed. If /NONOTIFY is specified, there
is no notification. The default is /NOTIFY.
`,
},
- {
- Name: "/NOW",
+ "/NOW": {
Description: `Sends all messages that have been queued for printing with the PRINT
command during this session to the printer.
`,
},
- {
- Name: "/QUEUE",
+ "/QUEUE": {
Description: `/QUEUE=queue_name
The name of the queue to which a message is to be sent. If the /QUEUE
@@ -1518,8 +1370,7 @@ qualifier is not specified, the message is queued to SYS$PRINT.
},
},
},
- {
- Command: "READ",
+ "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
@@ -1543,20 +1394,17 @@ read in a folder on a per message basis. For information on this, see
the help on the SEEN command.
`,
Flags: dclish.Flags{
- {
- Name: "/ALL",
+ "/ALL": {
Description: `Specifies to read all messages. Used after /MARKED, /UNMARKED, /SEEN,
or /UNSEEN had been specified.
`,
},
- {
- Name: "/EDIT",
+ "/EDIT": {
Description: `Specifies that the editor is to be used to read the message. This is
useful for scanning a long message.
`,
},
- {
- Name: "/HEADER",
+ "/HEADER": {
Description: `/[NO]HEADER
Specifies that if a message header exists, the header will be shown.
@@ -1566,8 +1414,7 @@ NEWS folders, /NOHEADER for NEWS folders. If the SET STRIP command
is set for the folder, it will change the default to be /HEADER.
`,
},
- {
- Name: "/MARKED",
+ "/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
@@ -1575,8 +1422,7 @@ shown and be able to be read. To see all messages, use either /ALL,
or reselect the folder.
`,
},
- {
- Name: "/UNMARKED",
+ "/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
@@ -1584,16 +1430,14 @@ will be shown and be able to be read. To see all messages, either
reselect the folder or specify /ALL.
`,
},
- {
- Name: "/SEEN",
+ "/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.
`,
},
- {
- Name: "/UNSEEN",
+ "/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
@@ -1601,13 +1445,11 @@ shown and be able to be read. To see all messages, use either /ALL, or
reselect the folder.
`,
},
- {
- Name: "/NEW",
+ "/NEW": {
Description: `Specifies to read the first unread message.
`,
},
- {
- Name: "/PAGE",
+ "/PAGE": {
Description: `/[NO]PAGE
Specifies that the display of the message will pause when it reaches the
@@ -1617,8 +1459,7 @@ screenful at a time, and that have a remote printer that can then print
the contents of the terminal's memory.
`,
},
- {
- Name: "/SINCE",
+ "/SINCE": {
Description: `/SINCE=date
Specifies to read the first message created on or after the specified
@@ -1627,8 +1468,7 @@ date. If no date is specified, the default is TODAY.
},
},
},
- {
- Command: "REMOVE",
+ "REMOVE": {
Description: `Removes a folder. Only the owner of a folder or a privileged user can
remove the folder.
@@ -1636,8 +1476,7 @@ remove the folder.
REMOVE folder-name
`,
},
- {
- Command: "REPLY",
+ "REPLY": {
Description: `Adds message with subject of message being the subject of the currently
read message with "RE:" preceeding it. Format and qualifiers is exactly
the same as the ADD command except for /NOINDENT and /EXTRACT.
@@ -1646,23 +1485,20 @@ the same as the ADD command except for /NOINDENT and /EXTRACT.
REPLY [file-name]
`,
Flags: dclish.Flags{
- {
- Name: "/EXTRACT",
+ "/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.
`,
},
- {
- Name: "/NOINDENT",
+ "/NOINDENT": {
Description: `See /EXTRACT for information on this qualifier.
`,
},
},
},
- {
- Command: "RESPOND",
+ "RESPOND": {
Description: `Invokes the VAX/VMS Personal Mail Utility (MAIL) to send a reply mail
message to the owner of the currently read message.
@@ -1675,28 +1511,24 @@ place of MAIL, and the parameters passed to it are the username and subject
of the message.
`,
Flags: dclish.Flags{
- {
- Name: "/CC",
+ "/CC": {
Description: `/CC=user[s]
Specifies additional users that should receive the reply.
`,
},
- {
- Name: "/EDIT",
+ "/EDIT": {
Description: `Specifies that the editor is to be used for creating the reply mail
message.
`,
},
- {
- Name: "/EXTRACT",
+ "/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.
`,
},
- {
- Name: "/GROUPS",
+ "/GROUPS": {
Description: `/GROUPS=(newsgroup,[...])
Valid only if a NEWS group is selected and /LIST is present. Specifies
@@ -1704,28 +1536,24 @@ to send the message to the specified NEWS group(s) in addition to the
selected NEWS group.
`,
},
- {
- Name: "/LIST",
+ "/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.
`,
},
- {
- Name: "/NOINDENT",
+ "/NOINDENT": {
Description: `See /EXTRACT for information on this qualifier.
`,
},
- {
- Name: "/NOSIGNATURE",
+ "/NOSIGNATURE": {
Description: `Specifies to suppress the 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.
`,
},
- {
- Name: "/SUBJECT",
+ "/SUBJECT": {
Description: `/SUBJECT=text
Specifies the subject of the mail message. If the text consists of more
@@ -1737,14 +1565,12 @@ as the subject preceeded by "RE: ".
},
},
},
- {
- Command: "QUIT",
+ "QUIT": {
Description: `Exits the BULLETIN program.
`,
Action: ActionQuit,
},
- {
- Command: "SEARCH",
+ "SEARCH": {
Description: `Searches the currently selected folder for the message containing the
first occurrence of the specified text string.
@@ -1760,13 +1586,11 @@ one you are currently reading (or have just read). Once started, a
search can be aborted by typing a CTRL-C.
`,
Flags: dclish.Flags{
- {
- Name: "/EDIT",
+ "/EDIT": {
Description: `Specifies that the editor is to be used for reading the message.
`,
},
- {
- Name: "/FOLDER",
+ "/FOLDER": {
Description: `/FOLDER=(folder,[...])
Specifies a list of folders to be searched. The search will start by
@@ -1777,36 +1601,31 @@ selected folder can be included in the search by specifying "" as the
first folder in the list.
`,
},
- {
- Name: "/REPLY",
+ "/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:".
`,
},
- {
- Name: "/REVERSE",
+ "/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.
`,
},
- {
- Name: "/START",
+ "/START": {
Description: `/START=message_number
Specifies the message number to start the search at.
`,
},
- {
- Name: "/SUBJECT",
+ "/SUBJECT": {
Description: `Specifies that only the subject of the messages are to be searched.
`,
},
},
},
- {
- Command: "SEEN",
+ "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
@@ -1833,8 +1652,7 @@ the logical name BULL_MARK. If BULL_MARK is not defined, SYS$LOGIN
will be used.
`,
},
- {
- Command: "SELECT",
+ "SELECT": {
Description: `Selects a folder of messages. See HELP Folders for a description of a
folder. Once a folder has been selected, all commands, i.e. DIRECTORY,
READ, etc. will apply only to those messages. Use the CREATE command to
@@ -1865,8 +1683,7 @@ desired, you can select these groups by enclosing them in double quotes
("), and typing the name in lower case.
`,
Flags: dclish.Flags{
- {
- Name: "/MARKED",
+ "/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.
@@ -1874,8 +1691,7 @@ to be reselected.
},
},
},
- {
- Command: "SET",
+ "SET": {
Description: `The SET command is used with other commands to define or change
characteristics of the BULLETIN Utility.
@@ -1884,8 +1700,7 @@ characteristics of the BULLETIN Utility.
SET option
`,
Flags: dclish.Flags{
- {
- Name: "ACCESS",
+ "ACCESS": {
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.
@@ -1956,8 +1771,7 @@ have manually reset those defaults. The correct solution requires a
large programming modification, which will be done in a later version.
`,
},
- {
- Name: "ALWAYS",
+ "ALWAYS": {
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
@@ -1972,8 +1786,7 @@ sure they are read.
SET [NO]ALWAYS
`,
},
- {
- Name: "BBOARD",
+ "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
@@ -2104,8 +1917,7 @@ mailing list in the folder description in the format described under
HELP CREATE /DESCRIPTION.
`,
},
- {
- Name: "BRIEF",
+ "BRIEF": {
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
@@ -2137,8 +1949,7 @@ individual, except if changing to SHOWNEW or READNEW. This is a
privileged qualifier.
`,
},
- {
- Name: "CONTINUOUS_BRIEF",
+ "CONTINUOUS_BRIEF": {
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
@@ -2153,8 +1964,7 @@ NOTE: Both SET GENERIC and SET CONTINUOUS_BRIEF cannot be set for the
same user.
`,
},
- {
- Name: "DEFAULT_EXPIRE",
+ "DEFAULT_EXPIRE": {
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
@@ -2178,8 +1988,7 @@ NOTE: This value is the same value that SET BBOARD/EXPIRATION specifies.
If one is changed, the other will change also.
`,
},
- {
- Name: "DIGEST",
+ "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
@@ -2194,8 +2003,7 @@ The command SHOW FOLDER/FULL will show if DIGEST has been set.
`,
},
- {
- Name: "DUMP",
+ "DUMP": {
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.
@@ -2208,8 +2016,7 @@ The command SHOW FOLDER/FULL will show if dump has been set. (NOTE:
SHOW FOLDER/FULL is a privileged command.)
`,
},
- {
- Name: "EXPIRE_LIMIT",
+ "EXPIRE_LIMIT": {
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.
@@ -2220,8 +2027,7 @@ The command SHOW FOLDER/FULL will show the expiration limit, if one
exists. (NOTE: SHOW FOLDER/FULL is a privileged command.)
`,
},
- {
- Name: "FOLDER",
+ "FOLDER": {
Description: `Select a folder of messages. Identical to the SELECT command. See help
on that command for more information.
@@ -2234,8 +2040,7 @@ After using /MARKED, in order to see all messages, the folder will have
to be reselected.
`,
},
- {
- Name: "GENERIC",
+ "GENERIC": {
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
@@ -2255,8 +2060,7 @@ Specifies the number days that new GENERAL messages will be displayed
for upon logging in.
`,
},
- {
- Name: "KEYPAD",
+ "KEYPAD": {
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
@@ -2267,8 +2071,7 @@ qualifier has been added to the BULLETIN command line.
SET [NO]KEYPAD
`,
},
- {
- Name: "LOGIN",
+ "LOGIN": {
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
@@ -2283,8 +2086,7 @@ flag.) This command is a privileged command.
SET [NO]LOGIN username
`,
},
- {
- Name: "NODE",
+ "NODE": {
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
@@ -2310,8 +2112,7 @@ Specifies the folder for which the node information is to modified.
If not specified, the selected folder is modified.
`,
},
- {
- Name: "NOTIFY",
+ "NOTIFY": {
Description: `Specifies whether you will be notified via a broadcast message when a
message is added to the selected folder.
@@ -2342,8 +2143,7 @@ Specifies that NOTIFY is a permanent flag and cannot be changed by the
individual. /DEFAULT must be specified. This is a privileged qualifier.
`,
},
- {
- Name: "PAGE",
+ "PAGE": {
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,
@@ -2356,8 +2156,7 @@ by specifying /NOPAGE on the command line to invoke BULLETIN.
SET [NO]PAGE
`,
},
- {
- Name: "PRIVILEGES",
+ "PRIVILEGES": {
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.
@@ -2377,8 +2176,7 @@ parameter will allow users holding that rights identifier to execute
privileged commands. If /NOID is specified, the identifier is removed.
`,
},
- {
- Name: "PROMPT_EXPIRE",
+ "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
@@ -2393,8 +2191,7 @@ privileges, then an error will result.) PROMPT_EXPIRE is the default.
SET [NO]PROMPT_EXPIRE
`,
},
- {
- Name: "READNEW",
+ "READNEW": {
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
@@ -2438,8 +2235,7 @@ Specifies that READNEW is a permanent flag and cannot be changed by the
individual. This is a privileged qualifier.
`,
},
- {
- Name: "SHOWNEW",
+ "SHOWNEW": {
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
@@ -2474,8 +2270,7 @@ Specifies that SHOWNEW is a permanent flag and cannot be changed by the
individual, except if changing to READNEW. This is a privileged qualifier.
`,
},
- {
- Name: "STRIP",
+ "STRIP": {
Description: `Affect only messages which are added via either the BBOARD option, or
written directly from a network mailing program (i.e. PMDF). If
STRIP is set, the header of the mail message will be stripped off
@@ -2488,8 +2283,7 @@ before it is stored as a BULLETIN message.
The command SHOW FOLDER/FULL will show if STRIP has been set.
`,
},
- {
- Name: "SYSTEM",
+ "SYSTEM": {
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.
@@ -2507,19 +2301,16 @@ folder at the other node is also a SYSTEM folder.
},
},
},
- {
- Command: "SHOW",
+ "SHOW": {
Description: `The SHOW command displays information about certain characteristics.
`,
Flags: dclish.Flags{
- {
- Name: "FLAGS",
+ "FLAGS": {
Description: `Shows whether BRIEF, NOTIFY, READNEW, or SHOWNEW has been set for the
currently selected folder.
`,
},
- {
- Name: "FOLDER",
+ "FOLDER": {
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.
@@ -2534,8 +2325,7 @@ private, and BBOARD information. This information is only those who
have access to that folder.
`,
},
- {
- Name: "KEYPAD",
+ "KEYPAD": {
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
@@ -2546,23 +2336,20 @@ NOTE: If the keypad is not enabled, PF2 is defined to be SET KEYPAD.
Prints the keypad definitions on the default printer (SYS$PRINT).
`,
},
- {
- Name: "NEW",
+ "NEW": {
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.)
`,
},
- {
- Name: "PRIVILEGES",
+ "PRIVILEGES": {
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.)
`,
},
- {
- Name: "USER",
+ "USER": {
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
@@ -2612,16 +2399,14 @@ specified, the message number of the current message is used. Only
valid for newsgroups. Use /SINCE for folders and with /LOGIN.
`,
},
- {
- Name: "VERSION",
+ "VERSION": {
Description: `Shows the version of BULLETIN and the date that the executable was
linked.
`,
},
},
},
- {
- Command: "SPAWN",
+ "SPAWN": {
Description: `Creates a subprocess of the current process. To return to BULLETIN,
type LOGOUT.
@@ -2632,16 +2417,14 @@ NOTE: BULLETIN disables the use of CONTROL-C, so that you must use
CONTROL-Y if you wish to break out of a spawned command.
`,
},
- {
- Command: "SUBSCRIBE",
+ "SUBSCRIBE": {
Description: `Used only for NEWS folders. Specifies that BULLETIN will keep track of
the newest message that has been read for that NEWS folder. When the
NEWS folder is selected, the message pointer will automatically point to
the next newest message that has not been read.
`,
},
- {
- Command: "UNDELETE",
+ "UNDELETE": {
Description: `Undeletes he specified message if the message was deleted using the
DELETE command. Deleted messages are not actually deleted but have
their expiration date set to 15 minutes in the future and are deleted
@@ -2653,8 +2436,7 @@ string (DELETED) when either reading or doing a directory listing.
UNDELETE [message-number]
`,
},
- {
- Command: "UNSUBSCRIBE",
+ "UNSUBSCRIBE": {
Description: `Used only for NEWS folders. Specifies that BULLETIN will no longer keep
track of the newest message that has been read for that NEWS folder. See the
SUBSCRIBE command for further info.
diff --git a/repl/help.go b/repl/help.go
index 4322c5782fb9f7f62eebb9f82f5e00f656f081ef..2e57c4bd4598aacc85ff1702df002b5620fbef60 100644
--- a/repl/help.go
+++ b/repl/help.go
@@ -2,10 +2,27 @@
package repl
import (
+ "fmt"
+ "strings"
+
"git.lyda.ie/kevin/bulletin/dclish"
)
+var helpmap map[string]string
+
// ActionHelp handles the `HELP` command.
-func ActionHelp(_ *dclish.Command) error {
+func ActionHelp(cmd *dclish.Command) error {
+ if len(cmd.Args) == 0 {
+ fmt.Printf("%s\n", cmd.Description)
+ return nil
+ }
+ wordup := strings.ToUpper(cmd.Args[0])
+ helptext, ok := helpmap[wordup]
+ if !ok {
+ // TODO: add a help structure for topics that are not command.
+ fmt.Printf("ERROR: Topic not found: '%s'.\n", cmd.Args[0])
+ return nil
+ }
+ fmt.Printf("%s\n", helptext)
return nil
}