diff --git a/dclish/dclish.go b/dclish/dclish.go index 57aa8aa96157fd6a5c88e6e1fbe772f586018b4f..94ebb599dc4ed3b3e1d1f5a81a3edefb443eae7a 100644 --- a/dclish/dclish.go +++ b/dclish/dclish.go @@ -23,7 +23,6 @@ type Flags map[string]*Flag // Command contains the definition of a command, it's flags and subcommands. type Command struct { Flags Flags - FlagOrder []string Args []string MaxArgs int MinArgs int @@ -41,8 +40,23 @@ func (c Commands) ParseAndRun(line string) error { words := strings.Fields(line) cmd, ok := c[strings.ToUpper(words[0])] if !ok { - fmt.Printf("ERROR: Unknown command '%s'\n", words[0]) - return nil + wordup := strings.ToUpper(words[0]) + possibles := []string{} + for word := range c { + if strings.HasPrefix(word, wordup) { + possibles = append(possibles, word) + } + } + switch len(possibles) { + case 0: + fmt.Printf("ERROR: Unknown command '%s'\n", words[0]) + return nil + case 1: + cmd = c[possibles[0]] + default: + fmt.Printf("ERROR: Ambiguous command '%s' (matches %s)\n", words[0], possibles) + return nil + } } if cmd.Action == nil { fmt.Printf("ERROR: Command not implemented:\n%s\n", cmd.Description) diff --git a/repl/command.go b/repl/command.go index 72161f8ff31ba51e915667b00ab372bc542f9a1f..f3d5dd9a7f37567f531c08aec373d1efaf19b848 100644 --- a/repl/command.go +++ b/repl/command.go @@ -11,20 +11,18 @@ BULLETIN will ask for an expiration date and a header to contain the topic of the message. Format: - ADD [file-name] -`, + ADD [file-name]`, + MaxArgs: 1, 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. -`, +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. -`, +terminals when the message is broadcasted.`, }, "/BROADCAST": { Description: `This option is restricted to privileged users and SYSTEM folders. If @@ -34,38 +32,33 @@ 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.`, }, "/CLUSTER": { Description: `/[NO]CLUSTER This option specifies that broadcasted messages should be sent to all -nodes in the cluster. /CLUSTER is the default. -`, +nodes in the cluster. /CLUSTER is the default.`, }, "/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. -`, +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. -`, +used.`, }, "/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. -`, +suppressed with /NOINDENT.`, }, "/FOLDER": { Description: `/FOLDER=(foldername,[...]) @@ -88,13 +81,11 @@ ALL_FOLDERS after /FOLDER=. Note that the quotation marks are required. When using /FOLDER for remote nodes, proxy logins are used to determine if privileged options are allowed. If they are not allowed, the message -will still be added, but without the privileged settings. -`, +will still be added, but without the privileged settings.`, }, "/LOCAL": { Description: `Specifies that when /BROADCAST is specified for a remote folder, the -message is broadcasted ONLY on the local node. -`, +message is broadcasted ONLY on the local node.`, }, "/NODES": { Description: `/NODES=(nodes[,...]) @@ -112,30 +103,25 @@ more node names. I.e. $ DEFINE ALL_NODES "VAX1,VAX2,VAX3", and then specify /NODES=ALL_NODES. Note that the quotation marks are required. NOTE: It is preferable to use /FOLDER instead of /NODE if possible, -since adding messages via /FOLDER is much quicker. -`, +since adding messages via /FOLDER is much quicker.`, }, "/NOINDENT": { - Description: `See /EXTRACT for information on this qualifier. -`, + Description: `See /EXTRACT for information on this qualifier.`, }, "/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. -`, +See the help topic POST Signature_file for signature information.`, }, "/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. -`, +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.`, }, "/SHUTDOWN": { Description: `/SHUTDOWN[=nodename] @@ -150,21 +136,18 @@ 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. -`, +added. The nodename cannot be specified with a remote folder.`, }, "/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. -`, +This option is restricted to SYSTEM folders.`, }, "/USERNAME": { Description: `Specifies username to be used at remote DECNET nodes when adding messages -to DECNET nodes via the /NODE qualifier. -`, +to DECNET nodes via the /NODE qualifier.`, }, }, }, @@ -181,15 +164,14 @@ to get back to the BULLETN subprocess you already created. Format: - ATTACH [/PARENT] [process-name] -`, + ATTACH [/PARENT] [process-name]`, + MaxArgs: 1, Flags: dclish.Flags{ "Parameters": { Description: `process-name Indicates the name of the subprocess to which the connection is to be made. Only the /PARENT qualifier or a process-name may be specified. - `, }, "Qualifiers": { @@ -198,7 +180,6 @@ to get back to the BULLETN subprocess you already created. Allows you to attach to your process' parent process. If there is no parent process an error message is printed. - `, }, "Examples": { @@ -220,19 +201,16 @@ to get back to the BULLETN subprocess you already created. NOTE You always SPAWN a new process and ATTACH to a process that - already exists. -`, + already exists.`, }, }, }, "BACK": { - Description: `Displays the message preceding the current message. -`, + Description: `Displays the message preceding the current message.`, 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. -`, +useful for scanning a long message.`, }, "/HEADER": { Description: `/[NO]HEADER @@ -241,8 +219,7 @@ 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 for non- NEWS folders, /NOHEADER for NEWS folders. If the SET STRIP command -is set for the folder, it will change the default to be /HEADER. -`, +is set for the folder, it will change the default to be /HEADER.`, }, }, }, @@ -252,8 +229,7 @@ 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 the messages is optional. (See the command SET READNEW for info on automatic reading.) Messages are automatically deleted when their -expiration date has passed. -`, +expiration date has passed.`, }, "CHANGE": { Description: `Replaces or modifies existing stored message. This is for changing part @@ -267,45 +243,39 @@ the text, the old message text will be extracted. This can be suppressed by the qualifier /NEW. Format: - CHANGE [file-name] -`, + CHANGE [file-name]`, + MaxArgs: 1, 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. -`, +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. -`, +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. -`, +used. If no time is specified, you will be prompted for the time.`, }, "/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. -`, +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. -`, +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. -`, +new text is to be read in.`, }, "/NUMBER": { Description: `/NUMBER=message_number[-message_number1] @@ -316,32 +286,26 @@ 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. -`, +in place of an actual number, i.e. CURRENT-LAST, 1-CURRENT, etc.`, }, "/PERMANENT": { - Description: `Specifies that the message is to be made permanent. -`, + Description: `Specifies that the message is to be made permanent.`, }, "/SHUTDOWN[=nodename]": { Description: `Specifies that the message is to expire after the next computer -shutdown. This option is restricted to SYSTEM folders. -`, +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.`, }, "/SYSTEM": { Description: `Specifies that the message is to be made a SYSTEM message. This is a -privileged command and is restricted to SYSTEM folders. -`, +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.`, }, }, }, @@ -358,39 +322,35 @@ 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. -`, +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.`, }, "/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. -`, +the specified NEWS group(s) in addition to the selected NEWS group.`, }, "/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. -`, +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. -`, +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. -`, +the person copying the message.`, }, }, }, @@ -412,8 +372,9 @@ folder is stored in a file name created with the folder name). NOTE: Creation of folders may be a restricted command if the installer has elected to install it as such. This is done by modifying -BULLCOM.CLD. -`, +BULLCOM.CLD.`, + MinArgs: 1, + MaxArgs: 1, Flags: dclish.Flags{ "/ALWAYS": { Description: `Specifies that the folder has the ALWAYS attribute. This causes @@ -423,14 +384,12 @@ 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. -`, +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.) -`, +more information.)`, }, "/DESCRIPTION": { Description: `/DESCRIPTION=description @@ -454,8 +413,7 @@ logical name BULL_NEWS_MAILER (it is the same protocol used by the NEWS feature in order to respond to NEWS messages). The default protocol is IN%. If desired, you can specify the protocol with the address, i.e. - INFOVAX MAILING LIST <IN%"INFO-VAX@KL.SRI.COM"> -`, + INFOVAX MAILING LIST <IN%"INFO-VAX@KL.SRI.COM">`, }, "/ID": { Description: `Designates that the name specified as the owner name is a rights @@ -464,8 +422,7 @@ 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.`, }, "/NODE": { Description: `/NODE=node @@ -492,20 +449,17 @@ messages), or if a user accesses that folder. Thus, if the folder is located on node A, and the message is added from node B, and a user logs in to node C, the BULLETIN login notification might not notify the user of the message. However, if the message is added with /BROADCAST, the -message will be broadcasted immediately to all nodes. -`, +message will be broadcasted immediately to all nodes.`, }, "/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.) -`, +more information.)`, }, "/OWNER": { Description: `/OWNER=username Specifies the owner of the folder. This is a privileged command. -See also /ID. -`, +See also /ID.`, }, "/PRIVATE": { Description: `Specifies that the folder can only be accessed by users who have been @@ -514,32 +468,27 @@ 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. -`, +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.) -`, +more information.)`, }, "/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. -`, +assumed that the remote name is the same as the local name.`, }, "/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.) -`, +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. -`, +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 @@ -547,8 +496,7 @@ 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. -`, +folder at the other node is also a SYSTEM folder.`, }, }, }, @@ -559,13 +507,11 @@ of the message again, you can enter the CURRENT command. Format: - CURRENT -`, + CURRENT`, 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. -`, +useful for scanning a long message.`, }, "/HEADER": { Description: `/[NO]HEADER @@ -574,8 +520,7 @@ 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 for non- NEWS folders, /NOHEADER for NEWS folders. If the SET STRIP command -is set for the folder, it will change the default to be /HEADER. -`, +is set for the folder, it will change the default to be /HEADER.`, }, }, }, @@ -596,18 +541,16 @@ 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. -`, +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. -`, +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.`, }, "/NODES": { Description: `/NODES=(nodes[,...]) @@ -623,8 +566,7 @@ message that is to be deleted. Additionally, you can specify logical names which translate to one or more node names. I.e. $ DEFINE ALL_NODES "VAX1,VAX2,VAX3", and then -specify /NODES=ALL_NODES. Note that the quotation marks are required. -`, +specify /NODES=ALL_NODES. Note that the quotation marks are required.`, }, "/SUBJECT": { Description: `/SUBJECT=subject @@ -634,13 +576,11 @@ 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. -`, +You will be notified if the deletion was successful.`, }, "/USERNAME": { Description: `Specifies username to be used at remote DECNET nodes when deleting messages -on other DECNET nodes via the /NODE qualifier. -`, +on other DECNET nodes via the /NODE qualifier.`, }, }, }, @@ -656,110 +596,94 @@ If a folder is specified, that folder is selected before the directory is listed. Unless otherwise specified, listing starts with the first newest message. If there are no new messages, listing will start at the first message, or if a message has already been read, it will start at -that message. -`, +that message.`, + MaxArgs: 1, Flags: dclish.Flags{ "/ALL": { Description: `Lists all messages. Used if the qualifiers /MARKED, /UNMARKED, /SEEN, -or /UNSEEN were previously specified. -`, +or /UNSEEN were previously specified.`, }, "/DESCRIBE ": { Description: `Valid when used with /FOLDERS. Specifies to include description of -folder. -`, +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.`, }, "/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. -`, +newsgroups. To see newsgroups, use the NEWS command or DIR/NEWS.`, }, "/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. -`, +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. -`, +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. -`, +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. -`, +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. -`, +message.`, }, "/NEWS": { Description: `Lists the available news groups. This does the same thing as the NEWS -command. See that command for qualifiers which apply. -`, +command. See that command for qualifiers which apply.`, }, "/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). -`, +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. -`, +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. -`, +If no string is specified, the previously specified string is used.`, }, "/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. -`, +specified date. If no date is specified, the default is TODAY.`, }, "/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. -`, +command line DIRECTORY/START=3. Not valid with /FOLDER.`, }, "/SUBJECT": { Description: `/SUBJECT=[string] @@ -767,19 +691,16 @@ command line DIRECTORY/START=3. Not valid with /FOLDER. 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. -`, +is used.`, }, }, }, "EXIT": { - Description: `Exits the BULLETIN program. -`, - Action: ActionExit, + Description: `Exits the BULLETIN program.`, + Action: ActionExit, }, "EXTRACT": { - Description: `Synonym for FILE command. -`, + Description: `Synonym for FILE command.`, }, "FILE": { Description: `Copies the current message to the named file. The file-name parameter @@ -793,44 +714,38 @@ 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. -`, +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. -`, +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. -`, +file exists, the file would be appended to that file.`, }, }, }, "FIRST": { - Description: `Specifies that the first message in the folder is to be read. -`, + Description: `Specifies that the first message in the folder is to be read.`, }, "FORWARD": { - Description: `Synonym for MAIL command. -`, + Description: `Synonym for MAIL command.`, }, "HELP": { Description: `To obtain help on any topic, type: - HELP topic -`, + HELP topic`, Action: ActionHelp, }, "INDEX": { @@ -841,50 +756,42 @@ folder. It also can be used to continue the listing from where one left off after one has read a message. Format: - INDEX -`, + INDEX`, 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. -`, +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. -`, +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. -`, +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. -`, +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. -`, +be respecified.`, }, "/RESTART": { Description: `If specified, causes the listing to be reinitialized and start from the -first folder. -`, +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.`, }, }, }, @@ -909,20 +816,17 @@ first folder. | 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. -`, +useful for scanning a long message.`, }, "/HEADER": { Description: `/[NO]HEADER @@ -931,8 +835,7 @@ 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 for non- NEWS folders, /NOHEADER for NEWS folders. If the SET STRIP command -is set for the folder, it will change the default to be /HEADER. -`, +is set for the folder, it will change the default to be /HEADER.`, }, }, }, @@ -948,20 +851,19 @@ 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""". -`, +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. -`, +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. -`, +message is written in the mail. The default is to write the header.`, }, "/SUBJECT": { Description: `/SUBJECT=text @@ -970,8 +872,7 @@ 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. -`, +as the subject.`, }, }, }, @@ -991,8 +892,7 @@ NOTE: The list of marked messages for non-NEWS folders are stored in a file username.BULLMARK, and NEWS folders are stored in username.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. -`, +will be used.`, }, "MODIFY": { Description: `Modifies the database information for the current folder. Only the @@ -1000,8 +900,7 @@ owner of the folder or a user with privileges can use this command. Format: - MODIFY -`, + MODIFY`, Flags: dclish.Flags{ "/DESCRIPTION": { Description: `Specifies a new description for the folder. You will be prompted for @@ -1013,8 +912,7 @@ 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"> -`, + INFOVAX MAILING LIST <IN%"INFO-VAX@KL.SRI.COM">`, }, "/ID": { Description: `Designates that the name specified as the owner name is a rights @@ -1023,22 +921,19 @@ 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.`, }, "/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. -`, +account in order to okay the modification. See also /ID.`, }, }, }, @@ -1057,97 +952,48 @@ 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. -`, +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. -`, +message can be deleted from a remote folder at a time.`, }, "/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. -`, +the specified NEWS group(s) in addition to the selected NEWS group.`, }, "/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. -`, +The default is /NOHEADER.`, }, "/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. -`, +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. -`, - }, - }, - }, - "NEWS": { - Description: `Displays the list of available news groups. - -Format: - - NEWS [string] - -If the string is specified, lists news groups whose name contains that -string. If the string contains an asterisk, a wild card match will be -applied. I.e. if ALT* is specified, all groups starting with ALT will -be displayed. - -The status column of the display shows the status of the news group. -"y" means the news group is available. "m" means the news group is -moderated, and posting may or may not be allowable. "x" means the news -group has been deactived by the local server. "=" means the news group -has been renamed. The new name is shown on the display line immediately -following the old name. -`, - Flags: dclish.Flags{ - "/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. -`, - }, - "/START": { - Description: `/START=string - -If specified, the list will start with the first group which follows -alphabetically after that string. I.e. if /START=B is specified, the -list will start with groups whose name starts with a B. -`, - }, - "/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. -`, +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. -`, +that you would like to skip over.`, 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. -`, +useful for scanning a long message.`, }, "/HEADER": { Description: `/[NO]HEADER @@ -1156,8 +1002,7 @@ 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 for non- NEWS folders, /NOHEADER for NEWS folders. If the SET STRIP command -is set for the folder, it will change the default to be /HEADER. -`, +is set for the folder, it will change the default to be /HEADER.`, }, }, }, @@ -1169,41 +1014,35 @@ mailing list must be stored using either CREATE/DESCRIPTION or MODIFY/DESCRIPTION. See help on those commands for more information. Format: - POST [file-name] -`, + POST [file-name]`, + MaxArgs: 1, Flags: dclish.Flags{ "/CC": { Description: `/CC=user[s] -Specifies additional users that should receive the mail message. -`, +Specifies additional users that should receive the mail message.`, }, "/EDIT": { - Description: `Specifies that the editor is to be used for creating the mail message. -`, + Description: `Specifies that the editor is to be used for creating the mail message.`, }, "/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. -`, +beginning of each line. This can be suppressed with /NOINDENT.`, }, "/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. -`, +the specified NEWS group(s) in addition to the selected NEWS group.`, }, "/NOINDENT": { - Description: `See /EXTRACT for information on this qualifier. -`, + Description: `See /EXTRACT for information on this qualifier.`, }, "/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. -`, +See the help topic POST Signature_file for signature information.`, }, "/SUBJECT": { Description: `/SUBJECT=text @@ -1211,8 +1050,7 @@ See the help topic POST Signature_file for signature information. 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, you will prompted for the subject. -`, +If you omit this qualifier, you will prompted for the subject.`, }, "Signature_file": { Description: `It is possibly to have the contents of a file be automatically appended @@ -1237,8 +1075,7 @@ END This line will appear in all postings. Note that an empty line is automatically created to separate the text of -the message and the contents of the signature file. -`, +the message and the contents of the signature file.`, }, }, }, @@ -1262,12 +1099,11 @@ 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 -it's subject line, DIRECTORY/PRINT/SUBJ would allow you do it. -`, +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 @@ -1281,35 +1117,30 @@ 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.) -`, +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. -`, +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. -`, +is no notification. The default is /NOTIFY.`, }, "/NOW": { Description: `Sends all messages that have been queued for printing with the PRINT -command during this session to the printer. -`, +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. -`, +qualifier is not specified, the message is queued to SYS$PRINT.`, }, }, }, @@ -1334,18 +1165,16 @@ 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 -the help on the SEEN command. -`, +the help on the SEEN command.`, + MaxArgs: 1, Flags: dclish.Flags{ "/ALL": { Description: `Specifies to read all messages. Used after /MARKED, /UNMARKED, /SEEN, -or /UNSEEN had been specified. -`, +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. -`, +useful for scanning a long message.`, }, "/HEADER": { Description: `/[NO]HEADER @@ -1354,43 +1183,37 @@ 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 for non- NEWS folders, /NOHEADER for NEWS folders. If the SET STRIP command -is set for the folder, it will change the default to be /HEADER. -`, +is set for the folder, it will change the default to be /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. -`, +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. -`, +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. -`, +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. -`, +reselect the folder.`, }, "/NEW": { - Description: `Specifies to read the first unread message. -`, + Description: `Specifies to read the first unread message.`, }, "/PAGE": { Description: `/[NO]PAGE @@ -1399,15 +1222,13 @@ 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. -`, +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. -`, +date. If no date is specified, the default is TODAY.`, }, }, }, @@ -1416,8 +1237,9 @@ date. If no date is specified, the default is TODAY. remove the folder. Format: - REMOVE folder-name -`, + REMOVE folder-name`, + MinArgs: 1, + MaxArgs: 1, }, "REPLY": { Description: `Adds message with subject of message being the subject of the currently @@ -1425,19 +1247,17 @@ read message with "RE:" preceeding it. Format and qualifiers is exactly the same as the ADD command except for /NOINDENT and /EXTRACT. Format: - REPLY [file-name] -`, + REPLY [file-name]`, + MaxArgs: 1, Flags: dclish.Flags{ "/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. -`, +This can be suppressed with /NOINDENT.`, }, "/NOINDENT": { - Description: `See /EXTRACT for information on this qualifier. -`, + Description: `See /EXTRACT for information on this qualifier.`, }, }, }, @@ -1451,50 +1271,43 @@ message to the owner of the currently read 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. -`, +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.`, }, "/EDIT": { Description: `Specifies that the editor is to be used for creating the reply mail -message. -`, +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. -`, +This can be suppressed with /NOINDENT.`, }, "/GROUPS": { Description: `/GROUPS=(newsgroup,[...]) Valid only if a NEWS group is selected and /LIST is present. Specifies to send the message to the specified NEWS group(s) in addition to the -selected NEWS group. -`, +selected NEWS group.`, }, "/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. -`, +for more informaton.`, }, "/NOINDENT": { - Description: `See /EXTRACT for information on this qualifier. -`, + Description: `See /EXTRACT for information on this qualifier.`, }, "/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. -`, +See the help topic POST Signature_file for signature information.`, }, "/SUBJECT": { Description: `/SUBJECT=text @@ -1503,15 +1316,13 @@ 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: ". -`, +as the subject preceeded by "RE: ".`, }, }, }, "QUIT": { - Description: `Exits the BULLETIN program. -`, - Action: ActionQuit, + Description: `Exits the BULLETIN program.`, + Action: ActionQuit, }, "SEARCH": { Description: `Searches the currently selected folder for the message containing the @@ -1526,12 +1337,12 @@ 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. -`, +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,[...]) @@ -1541,30 +1352,25 @@ 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. -`, +first folder in the list.`, }, "/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:". -`, +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. -`, +message.`, }, "/START": { Description: `/START=message_number -Specifies the message number to start the search at. -`, +Specifies the message number to start the search at.`, }, "/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.`, }, }, }, @@ -1592,8 +1398,37 @@ NOTE: The list of SEEN messages for non-NEWS folders are stored in a file username.BULLMARK, and NEWS folders are stored in username.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. -`, +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 +command sets the current or message-id message as unseen. + + Format: + + SEEN [message-number or numbers] + UNSEEN [message-number or numbers] + +Keeping track of seen messages requires very little overhead for NEWS +folders. However, there is a moderate overhead for regular non-NEWS +folders. 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 for non-NEWS folders are stored in a +file username.BULLMARK, and NEWS folders are stored in +username.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, }, "SELECT": { Description: `Selects a folder of messages. See HELP Folders for a description of a @@ -1623,14 +1458,12 @@ detecting if a period is present in the name being specified, as most NEWS groups contain a period, whereas a real folder cannot. A few special NEWS groups, i.e. JUNK and CONTROL, do not contain a period. If desired, you can select these groups by enclosing them in double quotes -("), and typing the name in lower case. -`, +("), and typing the name in lower case.`, 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. -`, +to be reselected.`, }, }, }, @@ -1640,8 +1473,7 @@ characteristics of the BULLETIN Utility. Format: - SET option -`, + SET option`, Flags: dclish.Flags{ "ACCESS": { Description: `Controls access to a private folder. A private folder can only be @@ -1711,8 +1543,7 @@ extremely lengthy operation to check each user to see if have that id assigned to them. The alternative is to set the defaults for all users after every SET ACCESS, but that might cause problems with users who have manually reset those defaults. The correct solution requires a -large programming modification, which will be done in a later version. -`, +large programming modification, which will be done in a later version.`, }, "ALWAYS": { Description: `Specifies that the selected folder has the ALWAYS attribute. This @@ -1726,8 +1557,7 @@ sure they are read. Format: - SET [NO]ALWAYS -`, + SET [NO]ALWAYS`, }, "BBOARD": { Description: `Specifies a username to be used as a BBOARD destination. Mail which is @@ -1857,8 +1687,7 @@ 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. -`, +HELP CREATE /DESCRIPTION.`, }, "BRIEF": { Description: `Controls whether you will be alerted upon logging that there are new @@ -1889,8 +1718,7 @@ specified, the selected folder is modified. Valid only with NOBRIEF. Specifies that BRIEF is a permanent flag and cannot be changed by the individual, except if changing to SHOWNEW or READNEW. This is a -privileged qualifier. -`, +privileged qualifier.`, }, "CONTINUOUS_BRIEF": { Description: `Specifies that if BRIEF is set for a folder, and there are new messages, @@ -1904,8 +1732,7 @@ are detected. SET [NO]CONTINUOUS_BRIEF NOTE: Both SET GENERIC and SET CONTINUOUS_BRIEF cannot be set for the -same user. -`, +same user.`, }, "DEFAULT_EXPIRE": { Description: `Specifies the number of days the message created by BBOARD (or direct @@ -1928,8 +1755,7 @@ specified for a folder with a BBOARD, or else the messages will disappear. NOTE: This value is the same value that SET BBOARD/EXPIRATION specifies. -If one is changed, the other will change also. -`, +If one is changed, the other will change also.`, }, "DIGEST": { Description: `Affect only messages which are added via either the BBOARD option, or @@ -1943,7 +1769,6 @@ messages will be separated into individual BULLETIN messages. SET [NO]DIGEST The command SHOW FOLDER/FULL will show if DIGEST has been set. - `, }, "DUMP": { @@ -1956,8 +1781,7 @@ and it is located in the folder directory. SET [NO]DUMP The command SHOW FOLDER/FULL will show if dump has been set. (NOTE: -SHOW FOLDER/FULL is a privileged command.) -`, +SHOW FOLDER/FULL is a privileged command.)`, }, "EXPIRE_LIMIT": { Description: `Specifies expiration limit that is allowed for messages. Non-privileged @@ -1967,8 +1791,7 @@ specified. Privileged users can exceed the limit. SET [NO]EXPIRE_LIMIT [days] The command SHOW FOLDER/FULL will show the expiration limit, if one -exists. (NOTE: SHOW FOLDER/FULL is a privileged command.) -`, +exists. (NOTE: SHOW FOLDER/FULL is a privileged command.)`, }, "FOLDER": { Description: `Select a folder of messages. Identical to the SELECT command. See help diff --git a/repl/help.go b/repl/help.go index 490c80da81d7c55f6bb375ae0f9a235dfc44276e..007dfe03d9c8bba4710f044b89875ed38cc38b49 100644 --- a/repl/help.go +++ b/repl/help.go @@ -78,9 +78,24 @@ func ActionHelp(cmd *dclish.Command) error { wordup := strings.ToUpper(cmd.Args[0]) helptext, ok := helpmap[wordup] if !ok { - fmt.Printf("ERROR: Topic not found: '%s'.\n", cmd.Args[0]) - return nil + possibles := []string{} + for word := range helpmap { + if strings.HasPrefix(word, wordup) { + possibles = append(possibles, word) + } + } + switch len(possibles) { + case 0: + fmt.Printf("ERROR: Topic not found: '%s'.\n", cmd.Args[0]) + return nil + case 1: + helptext = helpmap[possibles[0]] + default: + fmt.Printf("ERROR: Ambiguous topic '%s' (matches %s)\n", cmd.Args[0], possibles) + return nil + } + } - fmt.Printf("%s\n", helptext) + fmt.Printf("%s\n\n", helptext) return nil }