Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve description of Error Handling exercise #719

Merged
merged 5 commits into from
Jan 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions exercises/practice/error-handling/.docs/instructions.append.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,14 @@
## 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 ""`

This is different from passing no arguments at all.

`./program`

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.