Megaf / Megaf/boxsay-lib

Replace nested if's with if...elif

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.