Skip to content

Commit 39269f6

Browse files
adding osExit var for better testing capabilities
1 parent cd1308a commit 39269f6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/natures.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"os"
1010
)
1111

12+
var osExit = os.Exit
13+
1214
func NaturesCommand() {
1315
flag.Usage = func() {
1416
helpMessage := styling.HelpBorder.Render(
@@ -28,7 +30,8 @@ func NaturesCommand() {
2830

2931
if err := ValidateNaturesArgs(os.Args); err != nil {
3032
fmt.Println(err.Error())
31-
os.Exit(1)
33+
osExit(1)
34+
return
3235
}
3336

3437
fmt.Println("Natures affect the growth of a Pokémon.\n" +
@@ -53,7 +56,7 @@ func NaturesCommand() {
5356
Rows(chart...).
5457
StyleFunc(func(row, col int) lipgloss.Style {
5558
return lipgloss.NewStyle().
56-
Padding(0, 1) // This styles the border color
59+
Padding(0, 1)
5760
})
5861

5962
fmt.Println(t.Render())

0 commit comments

Comments
 (0)