From 79fa55708e30ed968b08fedc2272971bbc0269ea Mon Sep 17 00:00:00 2001 From: Micael Marques Date: Mon, 10 Aug 2026 02:42:52 -0300 Subject: [PATCH] feat(cli): comando escondido parrot com a arara em ascii --- internal/cmd/parrot.go | 80 +++++++++++++++++++++++++++++++++++++ internal/cmd/parrot_test.go | 30 ++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 internal/cmd/parrot.go create mode 100644 internal/cmd/parrot_test.go diff --git a/internal/cmd/parrot.go b/internal/cmd/parrot.go new file mode 100644 index 0000000..657f9e1 --- /dev/null +++ b/internal/cmd/parrot.go @@ -0,0 +1,80 @@ +package cmd + +import ( + "github.com/spf13/cobra" +) + +// araraBanner is the jp2a render of the brand mark. Hidden command: not in +// help, found by the curious -- which is the whole point of an easter egg. +const araraBanner = ` + ....'. ... + ';cccccc .cccc:,. + .;ccccc. ccccccccc' + .:cccc. cccccccccc; + .:ccccc :cc. ;cccccccccc. + .:cccccc ccccccccc' + .,cccccccccc. . cccc + .'. ccccccc; .c:;,. .cc. + cccccccc. ;cc .c + 'cccccccc, + cccccccccc'. + ,ccccccccccc:'. + ccccccccccccccc:,. + .:cccccccccccccccccc:. + ;cccccccccccccccccccccc, + 'ccccccccccccccccccccccccc. + :cccccccccccccccccccccccccc. + 'cccccccccccccccccccccccccccc + ;cccccccccccccc cccccccccccc' + .cccccccccccccccc ccccccccccc, + .cccccccccccccccc' cccccccccc' + ;ccccccccccccccccc 'ccccccccc + ;ccccccccccccccccc. cccccccc; + :ccccccccccccccccc. cccccccc + .cccccccccccccccccc :cccccc. + .ccccccccccccccccc. .cccccc. + 'cccccccccccccccc' ;ccccc + ,ccccccccccccccc. ,ccccc + ,ccccccccccccc. .,ccccccc, + ;cccccccccc; .:ccccc. cc; + :ccccc' .,:cccc: .cc ;c: + .',:ccccccc;. .ccc. 'ccc. + ;ccccccccccccccccccccccccccccc. + :cccccccc, + .cccccccc, + cccccccc: + ;cccccccc + cccccccc + :ccccccc. + .ccccccc' + ccccccc, + .cccccc; + cccccc: + ;ccccc: + cccccc + :cccc: + cccc: + :ccc; + ccc' +,cc +: + + AraraHQ -- a operacao de WhatsApp para empresas. + Gostou do que viu por baixo do capo? oi@ararahq.com +` + +var parrotCmd = &cobra.Command{ + Use: "parrot", + Short: "Prints the arara", + Hidden: true, + RunE: runParrot, +} + +func init() { + rootCmd.AddCommand(parrotCmd) +} + +func runParrot(command *cobra.Command, arguments []string) error { + command.Print(araraBanner) + return nil +} diff --git a/internal/cmd/parrot_test.go b/internal/cmd/parrot_test.go new file mode 100644 index 0000000..ab6b551 --- /dev/null +++ b/internal/cmd/parrot_test.go @@ -0,0 +1,30 @@ +package cmd + +import ( + "bytes" + "strings" + "testing" +) + +func TestRunParrot_PrintsBannerWithContactPointer(t *testing.T) { + buffer := &bytes.Buffer{} + parrotCmd.SetOut(buffer) + + if err := runParrot(parrotCmd, nil); err != nil { + t.Fatalf("runParrot: %v", err) + } + + printed := buffer.String() + if !strings.Contains(printed, "AraraHQ") { + t.Errorf("banner missing brand name: %q", printed) + } + if !strings.Contains(printed, "oi@ararahq.com") { + t.Errorf("banner missing contact pointer") + } +} + +func TestParrotCmd_IsHiddenFromHelp(t *testing.T) { + if !parrotCmd.Hidden { + t.Error("parrot must stay hidden -- easter eggs do not appear in help") + } +}