Describe the bug
Running with no args on arch linux I don't have the "words" package installed. I get a panic. Not a big deal and easily worked around but a clear error message or even a small fallback list of words baked into the exe might be more graceful.
To Reproduce
Steps to reproduce the behavior:
Install typer on arch linux without the "words" package. Run it with no arguments.
Expected behavior
Fall back to some other word list, or print a simple error message.
Screenshots
❯ typer
panic: open /usr/share/dict/words: no such file or directory
goroutine 1 [running]:
github.com/tjarratt/babble.readAvailableDictionary()
/home/plyons/go/pkg/mod/github.com/tjarratt/[email protected]/babble_unix.go:14 +0x9c
github.com/tjarratt/babble.NewBabbler(...)
/home/plyons/go/pkg/mod/github.com/tjarratt/[email protected]/babble.go:22
github.com/maaslalani/typer/pkg/utility.RandomWords(0x14)
/home/plyons/go/pkg/mod/github.com/maaslalani/[email protected]/pkg/utility/utility.go:19 +0x6f
github.com/maaslalani/typer/pkg/typer.FromRandom(0xc000010010, 0x6f95c8)
/home/plyons/go/pkg/mod/github.com/maaslalani/[email protected]/pkg/typer/typer.go:54 +0x1e
github.com/maaslalani/typer/cmd.glob..func1(0x94d660, {0x6f6873, 0x0, 0x0})
/home/plyons/go/pkg/mod/github.com/maaslalani/[email protected]/cmd/root.go:58 +0x26b
github.com/spf13/cobra.(*Command).execute(0x94d660, {0xc000012200, 0x0, 0x0})
/home/plyons/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0x94d660)
/home/plyons/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x3ad
github.com/spf13/cobra.(*Command).Execute(...)
/home/plyons/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
github.com/maaslalani/typer/cmd.Execute()
/home/plyons/go/pkg/mod/github.com/maaslalani/[email protected]/cmd/root.go:68 +0x25
main.main()
/home/plyons/go/pkg/mod/github.com/maaslalani/[email protected]/main.go:6 +0x17
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.