Replace nested if's with if...elif
Open
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/Megaf/boxsay-lib/blob/stable/boxsay#L46
For example:
if [ "$x" = 1 ]; then
echo 1
elif [ "$x" = 2 ]; then
echo 2
else
echo error
fi
The bottom one could even use case ... esac
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the boxsay script at lines 46 and 66 and inspect the nested conditionals in those sections. Refactor them to use if...elif or case...esac where appropriate, then verify that the script produces the same terminal output for each condition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100