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
58 changes: 58 additions & 0 deletions pkg/cmd/art/art.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package art

import (
"fmt"
"time"

"github.com/algolia/cli/pkg/cmdutil"
"github.com/spf13/cobra"
)

var art = `
________________________
/ \
| _____ |
| _. XXXXX |
| X/ .<&%%Y%%&>. |
| .%#/ |##+\#%. |
| %#` + "`" + ` |#/ ` + "`" + `#% |
| %# + #% |
| ` + "`" + `%\ /%` + "`" + ` |
| \#%b.___.d%#/ |
| ` + "`" + `` + "`" + `+===+` + "`" + `` + "`" + ` |
| |
\ ________________________ /

Congratulations on your epic search!
You found the ☼art☼!
`

func NewArtCmd(f *cmdutil.Factory) *cobra.Command {
loadingMessages := []string{
"The legends speak of an Algolia developer so strong...",
"so capable...",
"so powerful at search and discovery...",
"that they could find the hidden art at the root of all things...",
"So spake the legends...",
}

cmd := &cobra.Command{
Use: "art",
Short: "We've been searching for the art for so long...!",
Run: func(cmd *cobra.Command, args []string) {
io := f.IOStreams
io.StartProgressIndicatorWithLabel("LEGENDARY QUEST ACCEPTED")
for i := 0; i < len(loadingMessages); i++ {
time.Sleep(2 * time.Second)
io.UpdateProgressIndicatorLabel(loadingMessages[i])
}
io.StopProgressIndicator()
fmt.Println(art)
},
Hidden: true,
}

cmdutil.DisableAuthCheck(cmd)

return cmd
}
4 changes: 4 additions & 0 deletions pkg/cmd/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/spf13/cobra"

"github.com/algolia/cli/pkg/cmd/apikey"
"github.com/algolia/cli/pkg/cmd/art"
"github.com/algolia/cli/pkg/cmd/factory"
"github.com/algolia/cli/pkg/cmd/index"
"github.com/algolia/cli/pkg/cmd/objects"
Expand Down Expand Up @@ -92,6 +93,9 @@ func NewRootCmd(f *cmdutil.Factory) *cobra.Command {
cmd.AddCommand(rules.NewRulesCmd(f))
cmd.AddCommand(synonyms.NewSynonymsCmd(f))

// ??? related commands
cmd.AddCommand(art.NewArtCmd(f))

return cmd
}

Expand Down