From c168913dab4d2e85ccd7623237ed1a816058bb65 Mon Sep 17 00:00:00 2001 From: Andy Li <1450947+andy1li@users.noreply.github.com> Date: Thu, 20 Nov 2025 17:43:18 +0900 Subject: [PATCH 1/2] Refine exit command documentation to remove optional exit status details and clarify termination behavior --- stage_descriptions/base-04-pn5.md | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/stage_descriptions/base-04-pn5.md b/stage_descriptions/base-04-pn5.md index f0681cc8..0c85c9d2 100644 --- a/stage_descriptions/base-04-pn5.md +++ b/stage_descriptions/base-04-pn5.md @@ -4,13 +4,7 @@ In this stage, you'll implement the `exit` builtin. The [`exit`](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#exit) builtin is a special command that terminates the shell. -It takes an optional numeric argument as the shell's [exit status](https://en.wikipedia.org/wiki/Exit_status): -```bash -$ exit 0 # Exit with status 0 (success) -$ exit 1 # Exit with status 1 (error) -``` - -When your shell receives the `exit` command, it should terminate immediately with the specified exit code. +When your shell receives the `exit` command, it should terminate immediately. ### Tests @@ -25,13 +19,7 @@ It will then send an invalid command to your shell, followed by the `exit` comma ```bash $ invalid_command_1 invalid_command_1: command not found -$ exit 0 +$ exit ``` -The tester will verify that: -- Your shell terminates after receiving the `exit` command -- Your shell exits with status code `0` - -### Notes - -- The tester will always pass in `0` as the argument to the `exit` command. +The tester will verify that your shell terminates after receiving the `exit` command. From 4b8f7cfa5d02debbbd09324c445f9da975a3b022 Mon Sep 17 00:00:00 2001 From: Andy Li <1450947+andy1li@users.noreply.github.com> Date: Thu, 20 Nov 2025 18:03:35 +0900 Subject: [PATCH 2/2] Update command completion and exit behavior documentation for clarity --- stage_descriptions/completions-02-gm9.md | 15 ++++++++------- stage_descriptions/history-persistence-05-kz7.md | 6 +++--- stage_descriptions/history-persistence-06-jv2.md | 6 +++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/stage_descriptions/completions-02-gm9.md b/stage_descriptions/completions-02-gm9.md index 13711603..b5a8d107 100644 --- a/stage_descriptions/completions-02-gm9.md +++ b/stage_descriptions/completions-02-gm9.md @@ -2,7 +2,7 @@ In this stage, you'll extend your shell's tab completion to handle commands with Your shell should now not only complete the command itself but also correctly handle the subsequent arguments that the user types. This means that after completing the command with ``, it should allow the user to continue typing arguments, and those arguments should also be interpreted correctly. -You'll need to ensure commands like `echo ` and `type` autocomplete and still function correctly with arguments. +You'll need to ensure commands like `echo` autocomplete and still function correctly with arguments. ### Tests @@ -15,11 +15,12 @@ The tester will execute your program like this: The tests will simulate user input with tab presses and will execute builtin commands, similar to the previous stage, with added arguments: 1. **Input:** `ech` `hello` - * The tester expects the shell to first complete the `ech` to `echo` after ``, then accept the `hello` argument, and after the `` key press, execute `echo hello`. - * The shell should output `hello`. -2. **Input:** `exi` `0` - * The tester expects the shell to first complete `exi` to `exit` after ``, then accept the `0` argument, and after the `` key press, execute `exit 0`. - * The shell should exit with status code 0. + - The tester expects the shell to first complete the `ech` to `echo` after ``, then accept the `hello` argument, and after the `` key press, execute `echo hello`. + - The shell should output `hello`. -The tester will verify that your shell properly completes the commands and executes the commands with the given arguments. \ No newline at end of file +2. **Input:** `ech` `foo bar` + - The tester expects the shell to first complete `ech` to `echo` after ``, then accept the `foo bar` arguments, and after the `` key press, execute `echo foo bar`. + - The shell should output `foo bar`. + +The tester will verify that your shell properly completes the commands and executes the commands with the given arguments. diff --git a/stage_descriptions/history-persistence-05-kz7.md b/stage_descriptions/history-persistence-05-kz7.md index bccec0c3..ab0657a8 100644 --- a/stage_descriptions/history-persistence-05-kz7.md +++ b/stage_descriptions/history-persistence-05-kz7.md @@ -15,7 +15,7 @@ $ echo hello hello $ echo world world -$ exit 0 +$ exit ``` The tester will then expect the history file's contents to look like: @@ -23,6 +23,6 @@ The tester will then expect the history file's contents to look like: ```txt echo hello echo world -exit 0 +exit <|EMPTY LINE|> -``` \ No newline at end of file +``` diff --git a/stage_descriptions/history-persistence-06-jv2.md b/stage_descriptions/history-persistence-06-jv2.md index cbbc06b8..f26bea2d 100644 --- a/stage_descriptions/history-persistence-06-jv2.md +++ b/stage_descriptions/history-persistence-06-jv2.md @@ -21,7 +21,7 @@ It will then send the following commands to your shell: ```bash $ echo new_command new_command -$ exit 0 +$ exit ``` The tester will then expect the history file's contents to look like: @@ -30,6 +30,6 @@ The tester will then expect the history file's contents to look like: echo initial_command_1 echo initial_command_2 echo new_command -exit 0 +exit <|EMPTY LINE|> -``` \ No newline at end of file +```