Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8165a6e

Browse files
authored
feat: Add spooky hidden flag (coder#1065)
1 parent a68b076 commit 8165a6e

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

cli/start.go

+22-2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func start() *cobra.Command {
6363
traceDatadog bool
6464
secureAuthCookie bool
6565
sshKeygenAlgorithmRaw string
66+
spooky bool
6667
)
6768

6869
root := &cobra.Command{
@@ -76,7 +77,7 @@ func start() *cobra.Command {
7677
defer tracer.Stop()
7778
}
7879

79-
printLogo(cmd)
80+
printLogo(cmd, spooky)
8081
listener, err := net.Listen("tcp", address)
8182
if err != nil {
8283
return xerrors.Errorf("listen %q: %w", address, err)
@@ -394,6 +395,8 @@ func start() *cobra.Command {
394395
cliflag.BoolVarP(root.Flags(), &secureAuthCookie, "secure-auth-cookie", "", "CODER_SECURE_AUTH_COOKIE", false, "Specifies if the 'Secure' property is set on browser session cookies")
395396
cliflag.StringVarP(root.Flags(), &sshKeygenAlgorithmRaw, "ssh-keygen-algorithm", "", "CODER_SSH_KEYGEN_ALGORITHM", "ed25519", "Specifies the algorithm to use for generating ssh keys. "+
396397
`Accepted values are "ed25519", "ecdsa", or "rsa4096"`)
398+
cliflag.BoolVarP(root.Flags(), &spooky, "spooky", "", "", false, "Specifies spookiness level")
399+
_ = root.Flags().MarkHidden("spooky")
397400

398401
return root
399402
}
@@ -464,7 +467,24 @@ func newProvisionerDaemon(ctx context.Context, client *codersdk.Client, logger s
464467
}), nil
465468
}
466469

467-
func printLogo(cmd *cobra.Command) {
470+
// nolint: revive
471+
func printLogo(cmd *cobra.Command, spooky bool) {
472+
if spooky {
473+
_, _ = fmt.Fprintf(cmd.OutOrStdout(), `
474+
▄████▄ ▒█████ ▓█████▄ ▓█████ ██▀███
475+
▒██▀ ▀█ ▒██▒ ██▒▒██▀ ██▌▓█ ▀ ▓██ ▒ ██▒
476+
▒▓█ ▄ ▒██░ ██▒░██ █▌▒███ ▓██ ░▄█ ▒
477+
▒▓▓▄ ▄██▒▒██ ██░░▓█▄ ▌▒▓█ ▄ ▒██▀▀█▄
478+
▒ ▓███▀ ░░ ████▓▒░░▒████▓ ░▒████▒░██▓ ▒██▒
479+
░ ░▒ ▒ ░░ ▒░▒░▒░ ▒▒▓ ▒ ░░ ▒░ ░░ ▒▓ ░▒▓░
480+
░ ▒ ░ ▒ ▒░ ░ ▒ ▒ ░ ░ ░ ░▒ ░ ▒░
481+
░ ░ ░ ░ ▒ ░ ░ ░ ░ ░░ ░
482+
░ ░ ░ ░ ░ ░ ░ ░
483+
░ ░
484+
485+
`)
486+
return
487+
}
468488
_, _ = fmt.Fprintf(cmd.OutOrStdout(), ` ▄█▀ ▀█▄
469489
▄▄ ▀▀▀ █▌ ██▀▀█▄ ▐█
470490
▄▄██▀▀█▄▄▄ ██ ██ █▀▀█ ▐█▀▀██ ▄█▀▀█ █▀▀

0 commit comments

Comments
 (0)