You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: stage_descriptions/completions-02-gm9.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ In this stage, you'll extend your shell's tab completion to handle commands with
2
2
3
3
Your shell should now not only complete the command itself but also correctly handle the subsequent arguments that the user types.
4
4
This means that after completing the command with `<TAB>`, it should allow the user to continue typing arguments, and those arguments should also be interpreted correctly.
5
-
You'll need to ensure commands like `echo` and `type` autocomplete and still function correctly with arguments.
5
+
You'll need to ensure commands like `echo` autocomplete and still function correctly with arguments.
6
6
7
7
### Tests
8
8
@@ -15,11 +15,12 @@ The tester will execute your program like this:
15
15
The tests will simulate user input with tab presses and will execute builtin commands, similar to the previous stage, with added arguments:
16
16
17
17
1.**Input:**`ech<TAB>``hello<ENTER>`
18
-
* The tester expects the shell to first complete the `ech` to `echo` after `<TAB>`, then accept the `hello` argument, and after the `<ENTER>` key press, execute `echo hello`.
19
-
* The shell should output `hello`.
20
18
21
-
2.**Input:**`exi<TAB>``0<ENTER>`
22
-
* The tester expects the shell to first complete `exi` to `exit` after `<TAB>`, then accept the `0` argument, and after the `<ENTER>` key press, execute `exit 0`.
23
-
* The shell should exit with status code 0.
19
+
- The tester expects the shell to first complete the `ech` to `echo` after `<TAB>`, then accept the `hello` argument, and after the `<ENTER>` key press, execute `echo hello`.
20
+
- The shell should output `hello`.
24
21
25
-
The tester will verify that your shell properly completes the commands and executes the commands with the given arguments.
22
+
2.**Input:**`ech<TAB>``foo bar<ENTER>`
23
+
- The tester expects the shell to first complete `ech` to `echo` after `<TAB>`, then accept the `foo bar` arguments, and after the `<ENTER>` key press, execute `echo foo bar`.
24
+
- The shell should output `foo bar`.
25
+
26
+
The tester will verify that your shell properly completes the commands and executes the commands with the given arguments.
0 commit comments