Skip to content

Commit

Permalink
Merge pull request nus-cs2103-AY2223S1#91 from ningtan11/master
Browse files Browse the repository at this point in the history
Fix inconsistencies in UG
  • Loading branch information
ningtan11 authored Oct 25, 2022
2 parents 9446379 + bd029a6 commit 3bbefc4
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 29 deletions.
25 changes: 12 additions & 13 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Waddle is a **simple, no-frills travel planning application catered to people wh
e.g. if the command specifies `c/CATEGORY d/DESCRIPTION`, `d/DESCRIPTION c/CATEGORY` is also acceptable.

* If a parameter is expected only once in the command but you specified it multiple times, only the last occurrence of the parameter will be taken.<br>
e.g. if you specify `d/Eat Ramen d/Aquarium`, only `p/Aquarium` will be taken.
e.g. if you specify `d/Eat Ramen d/Aquarium`, only `d/Aquarium` will be taken.

* Extraneous parameters for commands that do not take in parameters (such as `help`, `list`, `exit` and `clear`) will be ignored.<br>
e.g. if the command specifies `help 123`, it will be interpreted as `help`.
Expand All @@ -80,7 +80,7 @@ Format: `help`

Adds an itinerary to Waddle.

Format: `new n/NAME [c/COUNTRY] d/DURATION [s/START DATE] [p/NUMBER OF WADDLERS]`
Format: `new n/NAME [c/COUNTRY] dur/DURATION [s/START DATE] [p/NUMBER OF WADDLERS]`

Examples:
* `new n/My Japan Trip d/6`
Expand All @@ -92,31 +92,30 @@ Shows a list of all itineraries in Waddle.

Format: `list`

### Selecting an itinerary: `plan`
### Selecting an itinerary: `select`

Enters the planning page for the selected itinerary.

Format: `plan n/NAME`
Format: `select INDEX`

Examples:
* `plan n/My Japan Trip`
* `plan n/Germanyyyy`
* `select 1`

### Editing the details of an itinerary: `edit`

Edits an existing itinerary in Waddle.

Format: `edit INDEX [n/NAME] [c/COUNTRY] [d/DURATION] [s/START DATE] [p/NUMBER OF WADDLERS]`
Format: `edit INDEX [n/NAME] [c/COUNTRY] [dur/DURATION] [sd/START DATE] [p/NUMBER OF WADDLERS] [b/BUDGET]`

* Edits the itinerary at the specified `INDEX`. The index refers to the index number shown in the displayed itinerary list. The index **must be a positive integer** 1, 2, 3, …​
* At least one of the optional fields must be provided.
* Existing values will be updated to the input values.

Examples:
* `edit 1 d/15 s/04/10/22` Edits the duration and start date of the first itinerary to be `15` and `04/10/22` respectively.
* `edit 1 d/15 sd/04/10/22` Edits the duration and start date of the first itinerary to be `15` and `04/10/22` respectively.
* `edit 2 c/India` Edits the country of the second itinerary to be `India`.

### Locating persons by name: `find`
### Locating itineraries by name: `find`

Finds itineraries with names containing any of the given keywords.

Expand All @@ -126,7 +125,7 @@ Format: `find KEYWORD [MORE_KEYWORDS]`
* The order of the keywords does not matter. e.g. `Trip Japan My` will match `My Japan Trip`
* Only the name is searched.
* Only full words will be matched e.g. `Jap` will not match `Japan`
* Persons matching at least one keyword will be returned (i.e. `OR` search).
* Itineraries matching at least one keyword will be returned (i.e. `OR` search).
e.g. `Trip` will return `My Japan Trip`, `My Germany Trip`

Examples:
Expand All @@ -141,7 +140,7 @@ Deletes the specified itinerary from Waddle.
Format: `delete INDEX`

* Deletes the itinerary at the specified `INDEX`.
* The index refers to the index number shown in the displayed person list.
* The index refers to the index number shown in the displayed itinerary list.
* The index **must be a positive integer** 1, 2, 3, …​

Examples:
Expand Down Expand Up @@ -189,10 +188,10 @@ _Details coming soon ..._

Action | Format, Examples
--------|------------------
**New** | `new n/NAME [c/COUNTRY] d/DURATION [s/START DATE] [p/NUMBER OF WADDLERS]`<br> e.g., `new n/Germanyyyy c/Germany d/14 s/05/10/22 e/19/10/22 p/4`
**New** | `new n/NAME [c/COUNTRY] [du/DURATION] [s/START DATE] [p/NUMBER OF WADDLERS] [b/BUDGET]`<br> e.g., `new n/Germanyyyy c/Germany d/14 s/05/10/22 e/19/10/22 p/4 b/7000`
**Clear** | `clear`
**Delete** | `delete INDEX`<br> e.g., `delete 3`
**Edit** | `edit INDEX [n/NAME] [c/COUNTRY] [d/DURATION] [s/START DATE] [p/NUMBER OF WADDLERS]`<br> e.g.,`edit 1 d/15 s/04/10/22`
**Edit** | `edit INDEX [n/NAME] [c/COUNTRY] [d/DURATION] [s/START DATE] [p/NUMBER OF WADDLERS] [b/BUDGET]`<br> e.g.,`edit 1 d/15 s/04/10/22`
**Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find India Trip`
**List** | `list`
**Help** | `help`
4 changes: 2 additions & 2 deletions src/main/java/seedu/waddle/logic/commands/AddItemCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static java.util.Objects.requireNonNull;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_COST;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_DESCRIPTION;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_DURATION;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_ITEM_DURATION;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_PRIORITY;

import seedu.waddle.logic.StageManager;
Expand All @@ -25,7 +25,7 @@ public class AddItemCommand extends Command {
+ "[" + PREFIX_DESCRIPTION + "DESCRIPTION]"
+ "[" + PREFIX_PRIORITY + "PRIORITY]"
+ "[" + PREFIX_COST + "COST]"
+ "[" + PREFIX_DURATION + "DURATION]...\n"
+ "[" + PREFIX_ITEM_DURATION + "DURATION]...\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_DESCRIPTION + "Visit Taj Mahal "
+ PREFIX_PRIORITY + "3";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static java.util.Objects.requireNonNull;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_COST;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_DESCRIPTION;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_DURATION;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_ITEM_DURATION;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_PRIORITY;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_START_TIME;

Expand Down Expand Up @@ -37,7 +37,7 @@ public class EditItemCommand extends Command {
+ "[" + PREFIX_DESCRIPTION + "DESCRIPTION]"
+ "[" + PREFIX_PRIORITY + "PRIORITY]"
+ "[" + PREFIX_COST + "COST]"
+ "[" + PREFIX_DURATION + "DURATION]"
+ "[" + PREFIX_ITEM_DURATION + "DURATION]"
+ "[" + PREFIX_START_TIME + "START TIME]...\n"
+ "Example: " + COMMAND_WORD + " 1 "
+ PREFIX_DESCRIPTION + "Visit the Eiffel Tower ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static seedu.waddle.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_COST;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_DESCRIPTION;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_DURATION;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_ITEM_DURATION;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_PRIORITY;

import java.util.stream.Stream;
Expand All @@ -27,7 +27,7 @@ public class AddItemCommandParser implements Parser<AddItemCommand> {
public AddItemCommand parse(String args) throws ParseException {
ArgumentMultimap argMultimap =
ArgumentTokenizer.tokenize(args, PREFIX_DESCRIPTION, PREFIX_PRIORITY,
PREFIX_COST, PREFIX_DURATION);
PREFIX_COST, PREFIX_ITEM_DURATION);

if (!arePrefixesPresent(argMultimap, PREFIX_DESCRIPTION)
|| !argMultimap.getPreamble().isEmpty()) {
Expand All @@ -52,8 +52,8 @@ public AddItemCommand parse(String args) throws ParseException {
}

Duration duration;
if (arePrefixesPresent(argMultimap, PREFIX_DURATION)) {
duration = ParserUtil.parseDuration(argMultimap.getValue(PREFIX_DURATION).get());
if (arePrefixesPresent(argMultimap, PREFIX_ITEM_DURATION)) {
duration = ParserUtil.parseDuration(argMultimap.getValue(PREFIX_ITEM_DURATION).get());
} else {
duration = ParserUtil.parseDuration("0");
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/seedu/waddle/logic/parser/CliSyntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ public class CliSyntax {
/* Prefix definitions */
public static final Prefix PREFIX_NAME = new Prefix("n/");
public static final Prefix PREFIX_COUNTRY = new Prefix("c/");
public static final Prefix PREFIX_START_DATE = new Prefix("sd/");
public static final Prefix PREFIX_START_TIME = new Prefix("t/");
public static final Prefix PREFIX_ITINERARY_DURATION = new Prefix("dur/");
public static final Prefix PREFIX_START_DATE = new Prefix("s/");
public static final Prefix PREFIX_START_TIME = new Prefix("S/");
public static final Prefix PREFIX_ITINERARY_DURATION = new Prefix("du/");
public static final Prefix PREFIX_PEOPLE = new Prefix("p/");
public static final Prefix PREFIX_BUDGET = new Prefix("b/");
public static final Prefix PREFIX_DESCRIPTION = new Prefix("d/");
public static final Prefix PREFIX_PRIORITY = new Prefix("p/");
public static final Prefix PREFIX_COST = new Prefix("c/");
public static final Prefix PREFIX_DURATION = new Prefix("du/");
public static final Prefix PREFIX_ITEM_DURATION = new Prefix("du/");
public static final Prefix PREFIX_DAY_NUMBER = new Prefix("d/");

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import static seedu.waddle.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_COST;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_DESCRIPTION;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_DURATION;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_ITEM_DURATION;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_PRIORITY;
import static seedu.waddle.logic.parser.CliSyntax.PREFIX_START_TIME;

Expand All @@ -26,7 +26,7 @@ public EditItemCommand parse(String args) throws ParseException {
requireNonNull(args);
ArgumentMultimap argMultimap =
ArgumentTokenizer.tokenize(args, PREFIX_DESCRIPTION, PREFIX_PRIORITY,
PREFIX_COST, PREFIX_DURATION, PREFIX_START_TIME);
PREFIX_COST, PREFIX_ITEM_DURATION, PREFIX_START_TIME);

MultiIndex multiIndex;

Expand All @@ -53,9 +53,9 @@ public EditItemCommand parse(String args) throws ParseException {
ParserUtil.parseCost(argMultimap.getValue(PREFIX_COST).get()));
}

if (argMultimap.getValue(PREFIX_DURATION).isPresent()) {
if (argMultimap.getValue(PREFIX_ITEM_DURATION).isPresent()) {
editItemDescriptor.setDuration(
ParserUtil.parseDuration(argMultimap.getValue(PREFIX_DURATION).get()));
ParserUtil.parseDuration(argMultimap.getValue(PREFIX_ITEM_DURATION).get()));
}

if (argMultimap.getValue(PREFIX_START_TIME).isPresent()) {
Expand Down

0 comments on commit 3bbefc4

Please sign in to comment.