From fe5172c1b94749379b94169b42a9bf6b58396e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Pocztarski?= Date: Sun, 12 Jan 2025 21:09:45 +0100 Subject: [PATCH 1/5] Improve description of error handling exercise --- .../error-handling/.docs/instructions.append.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/exercises/practice/error-handling/.docs/instructions.append.md b/exercises/practice/error-handling/.docs/instructions.append.md index 4f2cabbd..c2433f0a 100644 --- a/exercises/practice/error-handling/.docs/instructions.append.md +++ b/exercises/practice/error-handling/.docs/instructions.append.md @@ -3,5 +3,15 @@ ## Bash-specific instructions The goal of this exercise is to consider the number of arguments passed to your program. -If there is exactly one argument, print a greeting message. -Otherwise print an error message and exit with a non-zero status. + +Note that you can pass empty strings as arguments: + +`./program ""` + +and it is not the same as not passing the argument at all: + +`./program` + +In this excercise, if your program is run with exactly one argument (even if it is an empty string), treat is as a person's name and print a greeting message, eg. `"Hello, Kate"` (or `"Hello, "` for the empty string). + +Otherwise if it is run with no arguments or more than one argument, print an error message `"Usage: error_handling.sh "` and exit with a non-zero status. From 079cb20b957ce9009154b80991dfac7e4b31e219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Pocztarski?= Date: Thu, 16 Jan 2025 18:33:10 +0100 Subject: [PATCH 2/5] Remove exact greeting and error from error handling exercise description --- .../practice/error-handling/.docs/instructions.append.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/practice/error-handling/.docs/instructions.append.md b/exercises/practice/error-handling/.docs/instructions.append.md index c2433f0a..25e09579 100644 --- a/exercises/practice/error-handling/.docs/instructions.append.md +++ b/exercises/practice/error-handling/.docs/instructions.append.md @@ -8,10 +8,10 @@ Note that you can pass empty strings as arguments: `./program ""` -and it is not the same as not passing the argument at all: +which is different from passing no arguments at all: `./program` -In this excercise, if your program is run with exactly one argument (even if it is an empty string), treat is as a person's name and print a greeting message, eg. `"Hello, Kate"` (or `"Hello, "` for the empty string). +In this excercise, if your program is run with exactly one argument (even if it is an empty string), treat is as a person's name and print a greeting message. -Otherwise if it is run with no arguments or more than one argument, print an error message `"Usage: error_handling.sh "` and exit with a non-zero status. +Otherwise if it is run with no arguments or more than one argument, print an error message and exit with a non-zero status. From dff3c43fc9f0025bd4aa28ad1092990d36b7f00e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Pocztarski?= Date: Sun, 19 Jan 2025 01:31:22 +0100 Subject: [PATCH 3/5] Improve language for error handling exercise Co-authored-by: Isaac Good --- exercises/practice/error-handling/.docs/instructions.append.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/error-handling/.docs/instructions.append.md b/exercises/practice/error-handling/.docs/instructions.append.md index 25e09579..7c9db099 100644 --- a/exercises/practice/error-handling/.docs/instructions.append.md +++ b/exercises/practice/error-handling/.docs/instructions.append.md @@ -8,7 +8,7 @@ Note that you can pass empty strings as arguments: `./program ""` -which is different from passing no arguments at all: +This is different from passing no arguments at all. `./program` From e4ac2159ac894cbe6034856b3026372e47f00017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Pocztarski?= Date: Sun, 19 Jan 2025 01:31:56 +0100 Subject: [PATCH 4/5] Fix punctuation for error handling exercise Co-authored-by: Isaac Good --- exercises/practice/error-handling/.docs/instructions.append.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/error-handling/.docs/instructions.append.md b/exercises/practice/error-handling/.docs/instructions.append.md index 7c9db099..c24a8ef1 100644 --- a/exercises/practice/error-handling/.docs/instructions.append.md +++ b/exercises/practice/error-handling/.docs/instructions.append.md @@ -4,7 +4,7 @@ The goal of this exercise is to consider the number of arguments passed to your program. -Note that you can pass empty strings as arguments: +Note that you can pass empty strings as arguments. `./program ""` From 2e3a0ddd93dbc56cdc660a57500488403f234908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Pocztarski?= Date: Sun, 19 Jan 2025 01:33:07 +0100 Subject: [PATCH 5/5] Improve grammar and clarify the error handling exercise description Co-authored-by: Isaac Good --- .../practice/error-handling/.docs/instructions.append.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/exercises/practice/error-handling/.docs/instructions.append.md b/exercises/practice/error-handling/.docs/instructions.append.md index c24a8ef1..f7c8e93d 100644 --- a/exercises/practice/error-handling/.docs/instructions.append.md +++ b/exercises/practice/error-handling/.docs/instructions.append.md @@ -12,6 +12,5 @@ This is different from passing no arguments at all. `./program` -In this excercise, if your program is run with exactly one argument (even if it is an empty string), treat is as a person's name and print a greeting message. - -Otherwise if it is run with no arguments or more than one argument, print an error message and exit with a non-zero status. +If your program is run with exactly one argument (even if it is an empty string), treat is as a person's name and print a greeting message. +If it is run with zero arguments or more than one argument, print an error message and exit with a non-zero status.