Skip to content

Commit c01553e

Browse files
authored
Merge pull request nus-cs2103-AY2021S1#92 from anthony6401/fix-duplicate-tag-branch
Fix duplicate tags bug and update fileAddress error message
2 parents b6727f1 + 5c4e6c4 commit c01553e

4 files changed

Lines changed: 8 additions & 11 deletions

File tree

src/main/java/seedu/address/logic/commands/ShowCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public class ShowCommand extends Command {
1919
public static final String COMMAND_WORD = "show";
2020

2121
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Shows a tag's file address. "
22-
+ "Parameters: "
22+
+ "\nParameters: "
2323
+ PREFIX_TAG_NAME + "TAG_NAME "
24-
+ "Example: " + COMMAND_WORD + " "
24+
+ "\nExample: " + COMMAND_WORD + " "
2525
+ PREFIX_TAG_NAME + "cs2103 ";
2626

2727
public static final String MESSAGE_SUCCESS = "%s's file path: %s";

src/main/java/seedu/address/logic/commands/TagCommand.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@
1717
public class TagCommand extends Command {
1818

1919
public static final String COMMAND_WORD = "tag";
20-
21-
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a tag to the HelleFile's address book.\n"
22-
+ "Parameters: "
20+
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a tag to the HelleFile's address book. "
21+
+ "\nParameters: "
2322
+ PREFIX_TAG_NAME + "TAG_NAME "
24-
+ PREFIX_FILE_ADDRESS + "FILE_ADDRESS\n"
25-
+ "Example: " + COMMAND_WORD + " "
23+
+ PREFIX_FILE_ADDRESS + "FILE_ADDRESS "
24+
+ "\nExample: " + COMMAND_WORD + " "
2625
+ PREFIX_TAG_NAME + "cs2103 "
2726
+ PREFIX_FILE_ADDRESS + "F:\\OneDrive\\CS2013T ";
2827

src/main/java/seedu/address/model/tag/FileAddress.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
*/
1010
public class FileAddress {
1111

12-
// TODO change message to be more understandable
13-
public static final String MESSAGE_CONSTRAINTS = "File addresses can take any values, and it should not be blank";
12+
public static final String MESSAGE_CONSTRAINTS = "File address can only take a valid file path!";
1413

1514
/*
1615
* The first character of the address must not be a whitespace,

src/main/java/seedu/address/model/tag/Tag.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ public boolean isSameTag(Tag otherTag) {
4545
}
4646

4747
return otherTag != null
48-
&& otherTag.getTagName().equals(getTagName())
49-
&& otherTag.getFileAddress().equals(getFileAddress());
48+
&& otherTag.getTagName().equals(getTagName());
5049
}
5150
/**
5251
* Returns true if both tag have the same identity and data fields.

0 commit comments

Comments
 (0)