Skip to content
Merged
Show file tree
Hide file tree
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
168 changes: 168 additions & 0 deletions internal/goodnight/goodnight.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
package goodnight

import "math/rand"

var goodNightArts = []string{
`
* . * . * . *
. _ . * .
* (o,o) . * .
. ( : ) * . *
("_("_) . * .
~ ~ ~ ~ ~ ~ ~
. * . * .
hoot hoot ~
`,
`
. * . * . * . * .
* ( ● )( ◑ )( ○ ) *
. * . *
* . *
. * . * .
* . * . * . * . *
drift off ~
`,
`
* . * . * . *
. * . * . *
* ) ) )
. ( ( ( * .
. ) ) ) ) . *
* ( ( ( ( (
. | | * . *
. | ~~~ |
\_____/ * * .
~ ~ ~ ~ ~ ~ ~ ~
rest well ~
`,
`
. * . . . * . . .
. . * . . . * . *
. . * . * .
* * . * . *
. * * . .
* * . . * *
. * * * .
follow the lights home
`,
`
* . * . * .
. +--------------------+
* | i . i . i . i|
. | i . i . i . i|
* | . i . i . i .|
. | . i . i . i .|
* | i . i . i . i|
. +--------------------+
nothing like rain to
drift off to
`,
`
* . * . * .
. * . * . *
. * ( ( ) ) . *
* . ) __ ( . *
. (_(____) *
* . | ~~~~| . *
. | | .
* . \____/ . *
. ~ ~ ~ ~ ~ .
* sip & sleep *
. * . * . *
`,
`
* . * . * .
. * . * . *
* . * . * .
. * /\ * . *
* . / \ . *
. / zZ \ * .
* . / zZ \ . *
. /_______ \ .
* ./___________\. *
~~~~~~~~~~~~~~~~~~~~~~~~
. camp under stars .
`,
`
. * . · . * . · .
· . * . · . * . *
. · ✦ . ✦ .
* ✦ . ✦ . *
. ✦ ✦ . .
* ✦ . . ✦ *
. ✦ ✦ ✦ .
* . · . * . · . *
. follow the light
* into dreamland . *
`,
`
. * . * . * . *
* .
. |\_/| * *
* |o o|__. .
. \ / \ * *
* /| | | .
. (_| |____) * *
* .
. * . * . * . *
purrfect dreams ~
`,
`
. * . * . * . *
* . * . .
. * ________ * *
* / . * \ .
. | . * * | * *
* | . * . * | .
. | * . * | * *
* \________/ .
. * . * . * . *
jar of tiny lights ~
Sleep thight ~
`,
`
* . * . *
. * .
* . * * . *
. _______________ .
* | ___________ | *
. | | chapter | | .
* | | 37: the | | *
. | | sleepy | | .
* | | ending | | *
. | |___________| | .
* |_______________| *
one more page... ~
`,
`
* . * . * .
. * . * .
* . * . *
. /\ .
* / \ *
. / .. \ .
* / .''. \ *
. / .' '. \ .
* / ' zZ ' \ *
. /____________ \ .
* ~~~~~~~~~~~~~~~~ *
tent under stars ~
`,
`
* . * . * .
. ________________ .
* | . * . |*
. | * . * . * |.
* | LOADING |*
. | DREAMS |.
* | [======== ] |*
. | 78%% ... |.
* |________________|*
. * . * . *.
almost there ~
`,
}

func RandomGoodNightArt() string {
return goodNightArts[rand.Intn(len(goodNightArts))]
}
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"os"

"github.com/TyostoKarry/sleepycli/internal/goodnight"
"github.com/spf13/pflag"
)

Expand All @@ -18,6 +19,7 @@ func main() {
bufferFlag int
cyclesMaxFlag int
cyclesMinFlag int
goodNightFlag bool
versionFlag bool
)

Expand All @@ -28,6 +30,7 @@ func main() {
pflag.IntVarP(&bufferFlag, "buffer", "b", 15, "Fall asleep buffer in minutes")
pflag.IntVarP(&cyclesMinFlag, "cycles-min", "n", 4, "Minimum cycles to show")
pflag.IntVarP(&cyclesMaxFlag, "cycles-max", "x", 6, "Maximum cycles to show")
pflag.BoolVarP(&goodNightFlag, "good-night", "", false, "Display a random good night art")
pflag.BoolVarP(&versionFlag, "version", "v", false, "Print version")

pflag.Parse()
Expand All @@ -37,6 +40,11 @@ func main() {
os.Exit(0)
}

if goodNightFlag {
fmt.Println(goodnight.RandomGoodNightArt())
os.Exit(0)
}

if err := validateAndSelectMode(wakeFlag, sleepFlag, fromFlag, toFlag, bufferFlag, cyclesMinFlag, cyclesMaxFlag); err != nil {
fmt.Fprintln(os.Stderr, "Error:", err)
os.Exit(1)
Expand Down