Skip to content

Commit 4a253d4

Browse files
authored
Merge pull request #123 from Seris370/UG
Update Quick Start
2 parents dfdbd51 + 4b3c8e2 commit 4a253d4

File tree

4 files changed

+34
-12
lines changed

4 files changed

+34
-12
lines changed

docs/UserGuide.adoc

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ifdef::env-github[]
1212
:tip-caption: :bulb:
1313
:note-caption: :information_source:
1414
endif::[]
15-
:repoURL: https://github.com/AY1920S1-CS2103T-W11-1/main/tree/master
15+
:repoURL: https://github.com/AY1920S1-CS2103T-W11-1/main
1616

1717
By: `Team CS2103T-W11-1` Since: `Sep 2019` Licence: `MIT`
1818

@@ -27,14 +27,22 @@ AlgoBase (AB) is for those who prefer to use a desktop app for managing algorith
2727
. Copy the file to the folder you want to use as the home folder for your AlgoBase application.
2828
. Double-click the file to start the app. The GUI should appear in a few seconds.
2929
+
30-
image::Ui.png[width="790"]
30+
image::Ui.png[width="80%"]
3131
+
3232
. Type the command in the command box and press kbd:[Enter] to execute it. +
3333
e.g. typing *`help`* and pressing kbd:[Enter] will list all possible commands in the result window and open the help window.
3434
. Some example commands you can try:
3535

3636
* *`list`* : lists all problems
3737
* **`add`**`n/factorial d/define a function factorial that takes in a number and n and returns the factorial of the number t/recursion a/Halim` : adds a problem called 'factorial' tagged with 'recursion' and authored by 'Wee Han'
38+
* **`edit`**`1 src/LeetCode` : edits the first problem displayed and sets its source to 'LeetCode'
39+
* **`switchtab`**`t/display i/2` : switches to tag tab
40+
* **`switchtab`**`t/display i/3` : switches to plan tab
41+
+
42+
image::UiStartPlan.png[width="60%"]
43+
+
44+
* **`findplan`**`n/CS2040` : finds plans that with name 'CS2040'
45+
* **`clear`** : resets Algobase
3846
* *`exit`* : exits the app
3947

4048
. Refer to <<Features>> for details of each command.
@@ -262,7 +270,7 @@ Format: `add n/NAME [d/DESCRIPTION] [start/START_DATE] [end/END_DATE]`
262270

263271
Examples:
264272

265-
* `addplan n/CS2040 d/past year questions in practical exams s/2019-01-01 e/3019-12-12`
273+
* `addplan n/CS2040 d/past year questions in practical exams start/2019-01-01 end/3019-12-12`
266274

267275
==== Deleting a plan : `deleteplan`
268276

@@ -295,7 +303,7 @@ Examples:
295303

296304
* `edit 1 d/past year questions of sit-in labs +
297305
Edits the description of the 1st plan to be `past year questions of sit-in labs` respectively.
298-
* `edit 2 s/2019-08-13` +
306+
* `edit 2 start/2019-08-13` +
299307
Edits the starting date of the 2nd plan to be `2019-08-13`.
300308

301309
==== Listing all plans : `listplan`
@@ -362,7 +370,7 @@ Examples:
362370
==== Locating plans: `findplan`
363371

364372
Finds plans fulfilling all provided constraints. +
365-
Format: `findplan [n/NAME] [d/DESCRIPTION] [start/RANGE_START] [end/RANGE_END]...`
373+
Format: `findplan [n/NAME] [d/DESCRIPTION] [start/RANGE_START] [end/RANGE_END]`
366374

367375
* Name
368376
** is case-insensitive.
@@ -460,7 +468,7 @@ Format: `rewind INDEX`
460468
kbd:[Ctrl + ↑] is shortcut for `rewind 1`
461469

462470
[NOTE]
463-
Since kbd:[Ctrl + ↑] is equivalent to executing `rewind 1`, you should not expect to rewind multiple commands back if you press the shortcut multiple times - it will always show you the last successfully executed command, if any. If you want to rewind several commands back
471+
Since kbd:[Ctrl + ↑] is equivalent to executing `rewind 1`, you should not expect to rewind multiple commands back if you press the shortcut multiple times - it will always show you the last successfully executed command, if any. if you want to rewind several commands back, please use `rewind INDEX` instead.
464472

465473
* `find n/Sequences` +
466474
`rewind 1` +
@@ -519,11 +527,13 @@ e.g. `deletetag 3`
519527

520528
* *Add Training Plan* : `addplan n/NAME [d/DESCRIPTION] [start/START_DATE] [end/END_DATE]` +
521529
e.g. `addplan n/CS2040`
522-
* *Edit Training Plan* : `editplan INDEX [a/ADD_PROBLEM_INDEX_LIST] [d/DELETE_PROBLEM_INDEX_LIST] [n/NAME] [d/DESCRIPTION] [start/START_DATE] [end/END_DATE]` +
523-
e.g. `editplan 1 a/1 2 3 d/4 5 6 n/training set 1`
524-
* *Find Training Plan* : `findplan KEYWORD [MORE_KEYWORDS]` +
525-
e.g. `find training set`
530+
* *Edit Training Plan* : `editplan INDEX [n/NAME] [d/DESCRIPTION] [start/START_DATE] [end/END_DATE]` +
531+
e.g. `editplan 1 n/training start/2020-02-02`
532+
* *Find Training Plans* : `findplan [n/NAME] [d/DESCRIPTION] [start/RANGE_START] [end/RANGE_END]` +
533+
e.g. `find n/CS2040 start/2019-03-01 end/2019-03-31`
526534
* *List Training Plans* : `listplan`
535+
* *Delete Training Plan* : `deleteplan INDEX` +
536+
e.g. `deleteplan 2`
527537
* *Add Task to Training Plan* : `addtask plan/PLAN_INDEX prob/PROBLEM_INDEX` +
528538
e.g. `addtask plan/1 prob/2`
529539
* *Delete Task from Training Plan* : `deletetask plan/PLAN_INDEX task/TASK_INDEX` +
@@ -542,6 +552,9 @@ e.g. `export format/json path/.`
542552
* *Importing data* : `import format/FORMAT path/FILE_PATH` +
543553
e.g. `import format/json path/./steven_halim_secret.json`
544554

555+
* *Rewind Command History* : `rewind INDEX` +
556+
e.g. `rewind 1`
557+
545558
* *Help* : `help`
546559
* *Clear* : `clear`
547560
* *Exit* : `exit`

docs/images/UiStartPlan.png

206 KB
Loading

src/main/java/seedu/algobase/logic/parser/FindPlanCommandParser.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import static seedu.algobase.logic.parser.CliSyntax.PREFIX_END_DATE;
66
import static seedu.algobase.logic.parser.CliSyntax.PREFIX_NAME;
77
import static seedu.algobase.logic.parser.CliSyntax.PREFIX_START_DATE;
8-
import static seedu.algobase.logic.parser.ParserUtil.arePrefixesPresent;
8+
import static seedu.algobase.logic.parser.ParserUtil.hasPrefixesPresent;
99
import static seedu.algobase.logic.parser.ParserUtil.parseDate;
1010

1111
import java.time.LocalDate;
@@ -46,7 +46,8 @@ public FindPlanCommand parse(String args) throws ParseException {
4646
ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_DESCRIPTION,
4747
PREFIX_START_DATE, PREFIX_END_DATE);
4848

49-
if (!arePrefixesPresent(argumentMultimap, PREFIX_NAME)
49+
if (!hasPrefixesPresent(argumentMultimap, PREFIX_NAME, PREFIX_DESCRIPTION,
50+
PREFIX_START_DATE, PREFIX_END_DATE)
5051
|| !argumentMultimap.getPreamble().isBlank()) {
5152
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, FindPlanCommand.MESSAGE_USAGE));
5253
}

src/main/java/seedu/algobase/logic/parser/ParserUtil.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,14 @@ public static boolean arePrefixesPresent(ArgumentMultimap argumentMultimap, Pref
269269
return Stream.of(prefixes).allMatch(prefix -> argumentMultimap.getValue(prefix).isPresent());
270270
}
271271

272+
/**
273+
* Returns true if some of the prefixes contain present {@code Optional} values in the given
274+
* {@code ArgumentMultimap}.
275+
*/
276+
public static boolean hasPrefixesPresent(ArgumentMultimap argumentMultimap, Prefix... prefixes) {
277+
return Stream.of(prefixes).anyMatch(prefix -> argumentMultimap.getValue(prefix).isPresent());
278+
}
279+
272280
/** Parses a {@code String date} into an {@code LocalDate}.
273281
*
274282
* @throws ParseException if the given {@code date} is invalid.

0 commit comments

Comments
 (0)