diff --git a/docs/UserGuide.md b/docs/UserGuide.md index dc76bdea199..5c2e3fb8585 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -104,7 +104,7 @@ Format: `list` Edits an existing student in the address book. -Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [g/GRADE] [s/SUBJECT] [at/ATTENDANCE] [pa/PAYMENT] [d/DATETIME]…​ [t/TAG]…​` +Format: `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [g/GRADE] [s/SUBJECT] [at/ATTENDANCE] [pa/PAYMENT] [d/DATETIME]…​ [t/TAG]…​` * Refer to [Features](#features) to view the accepted grade inputs, and the [Filter](#filter-student-by-grade--subject--filter) command for `GRADE` and `SUBJECT` constraints. * Edits the student at the specified `INDEX`. The index refers to the index number shown in the displayed student list. The index **must be a positive integer** 1, 2, 3, …​ @@ -198,14 +198,36 @@ Examples: ### Command history : `history` -Shows previous successful command history. Enter [list](#listing-all-students--list) to view the student list. Ignores saving `history` command itself. +There are two differing behaviours for this function. +* Lists down the last 10 successful commands in an independent command history list. +* Re-run commands based on the specified index. + +Enter [list](#listing-all-students--list) to return back to the student list. + +Format syntax and more information below. Format: `history [INDEX]` -* Leaving whitespace / not entering index will list out the command history. -* The index refers to the index number shown in the displayed command history list. -* The index **must be a positive integer**, and should be within the list's boundaries. -* Lists previous 10 commands by default. +* Upon entering `history` (i.e. leaving whitespace / not entering any index): + * it will show a command history list, featuring a new, independent list showing previous successful commands. + * The command history list also ignores saving `history` command itself. + * Lists at most 10 successful commands. + +* Upon entering `history [INDEX]`: + * It will re-run the command that was specified by the index. + * The index here refers to the index number shown in the command history list. + * The index **must be a positive integer**, and should be within the list's boundaries. + * The output message is determined by the re-run command. (i.e. `history [INDEX]` itself does not have any success message.) + +Examples: + +* `history` returns a command history list. +![history](images/commandHistory.png) + +* `history 1` runs the `list` command and returns the student list. It also outputs the success message of `list`. +![history 1](images/commandHistory1.png) + + ### Clearing all entries : `clear` @@ -232,9 +254,14 @@ If your changes to the data file makes its format invalid, AddressBook will disc Furthermore, certain edits can cause the AddressBook to behave in unexpected ways (e.g., if a value entered is outside of the acceptable range). Therefore, edit the data file only if you are confident that you can update it correctly. -### Archiving data files `[coming in v2.0]` +-------------------------------------------------------------------------------------------------------------------- + +## Planned Enhancements + +Team size: 4 -_Details coming soon ..._ +1. Improve readability of command history list: As of v1.3, the output of each command in the history is verbose, and introduces a lot of user-unfriendly code to the user. We plan to show only the command output that was typed by the user. +2. Comprehensiveness of error messages: Error messages for list indexes <= 0 are inconsistent with positive indexes, even though the index is compliant with the command format. Examples of commands requiring indexes are `delete`, `edit`, `history`. We plan to ensure consistency with the error message so long as it is an index value. -------------------------------------------------------------------------------------------------------------------- diff --git a/docs/images/commandHistory.png b/docs/images/commandHistory.png new file mode 100644 index 00000000000..037e37cebce Binary files /dev/null and b/docs/images/commandHistory.png differ diff --git a/docs/images/commandHistory1.png b/docs/images/commandHistory1.png new file mode 100644 index 00000000000..221e5b74cc5 Binary files /dev/null and b/docs/images/commandHistory1.png differ diff --git a/docs/images/helpMessage.png b/docs/images/helpMessage.png index 6fe970b8736..b09acb911c2 100644 Binary files a/docs/images/helpMessage.png and b/docs/images/helpMessage.png differ diff --git a/src/main/java/seedu/address/logic/commands/HistoryCommand.java b/src/main/java/seedu/address/logic/commands/HistoryCommand.java index a8d95738fdd..c36237e63b0 100644 --- a/src/main/java/seedu/address/logic/commands/HistoryCommand.java +++ b/src/main/java/seedu/address/logic/commands/HistoryCommand.java @@ -19,9 +19,9 @@ public class HistoryCommand extends Command { public static final String COMMAND_WORD = "history"; public static final String MESSAGE_USAGE = COMMAND_WORD - + ": Lists command history. Runs the command when index is specified. \n" + + ": Lists command history. Runs the command when INDEX is specified. \n" + "Parameters: INDEX (must be a positive integer)\n" - + "Example: " + COMMAND_WORD + " 1"; + + "Example: " + COMMAND_WORD + ", " + COMMAND_WORD + " 1"; public static final String MESSAGE_HISTORY_SUCCESS = "Command History listed."; diff --git a/src/main/java/seedu/address/ui/HelpWindow.java b/src/main/java/seedu/address/ui/HelpWindow.java index 1d548e3305d..3ca4edb2ae0 100644 --- a/src/main/java/seedu/address/ui/HelpWindow.java +++ b/src/main/java/seedu/address/ui/HelpWindow.java @@ -16,27 +16,29 @@ public class HelpWindow extends UiPart { public static final String USERGUIDE_URL = - "https://github.com/AY2324S2-CS2103-F15-2/tp/blob/master/docs/UserGuide.md"; + "https://ay2324s2-cs2103-f15-2.github.io/tp/UserGuide.html"; public static final String HELP_MESSAGE = "Here are the list of commands that are available for use: \n" + " - Viewing help : 'help'\n\n" + " - Adding a student: 'add'\n" + " Usage: 'add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [g/GRADE] [s/SUBJECT] " - + "[d/DATETIME] [at/ATTENDANCE] [pa/PAYMENT] [t/TAG]…'\n\n" + + "[at/ATTENDANCE] [pa/PAYMENT] [d/DATETIME] [t/TAG]…'\n\n" + " - Listing all persons : 'list'\n\n" + " - Editing a person : 'edit'\n" - + " Usage: 'edit INDEX n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [g/GRADE] [s/SUBJECT] " - + "[d/DATETIME] [at/ATTENDANCE] [pa/PAYMENT] [t/TAG]…'\n\n" + + " Usage: 'edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [g/GRADE] [s/SUBJECT] " + + "[at/ATTENDANCE] [pa/PAYMENT] [d/DATETIME] [t/TAG]…'\n\n" + " - Locating persons by name: 'find'\n" + " Usage: 'find KEYWORD [MORE_KEYWORDS]'\n\n" + " - Deleting a person : 'delete'\n" + " Usage: 'delete INDEX'\n\n" - + " - Filter by Grade / Subject: 'filter [g/GRADE] [s/SUBJECT]'\n" - + " Usage: 'filter g/A s/Maths'\n\n" - + " - Categorise by Payment: 'payment pa/PAYMENT'\n" - + " Usage: 'payment pa/Not Paid'\n\n" + + " - Filtering by Grade / Subject: 'filter'\n" + + " Usage: 'filter [g/GRADE] [s/SUBJECT]'\n\n" + + " - Categorising by Payment: 'payment'\n" + + " Usage: 'payment pa/PAYMENT'\n\n" + " - Viewing Calendar : 'view'\n\n" - + " - Show previous successful commands : 'history'\n\n" + + " - Showing list of previously successful commands : 'history'\n\n" + + " - Executing command in command history list : 'history'\n" + + " Usage: 'history [INDEX]'\n\n" + " - Clearing all entries : 'clear'\n\n" + " - Exiting the program : 'exit'\n\n" + "You can view the complete user guide at "