Skip to content

Commit

Permalink
feat: octopus logo on root help page
Browse files Browse the repository at this point in the history
  • Loading branch information
NickDeChip authored Oct 31, 2022
1 parent 564dcff commit 1953205
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/config/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func promptMissing(ask question.Asker) (string, error) {
constants.ConfigNoPrompt,
constants.ConfigHost,
constants.ConfigOutputFormat,
// constants.ConfigShowOctopus,
constants.ConfigShowOctopus,
constants.ConfigEditor,
// constants.ConfigProxyUrl,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/config/set/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func promptMissing(ask question.Asker, key string) (string, string, error) {
constants.ConfigNoPrompt,
constants.ConfigHost,
constants.ConfigOutputFormat,
// constants.ConfigShowOctopus,
constants.ConfigShowOctopus,
constants.ConfigEditor,
// constants.ConfigProxyUrl,
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/cmd/root/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import (
"regexp"
"strings"

"github.com/OctopusDeploy/cli/pkg/constants"
"github.com/OctopusDeploy/cli/pkg/constants/annotations"
"github.com/OctopusDeploy/cli/pkg/output"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)

func isRootCmd(cmd *cobra.Command) bool {
Expand Down Expand Up @@ -63,6 +65,9 @@ func rootHelpFunc(cmd *cobra.Command, _ []string) {
if longText != "" {
helpEntries = append(helpEntries, helpEntry{"", longText})
}
if isRootCmd(cmd) && viper.GetBool(constants.ConfigShowOctopus) {
helpEntries = append(helpEntries, helpEntry{"", output.Bluef("%s", constants.OctopusLogo)})
}
helpEntries = append(helpEntries, helpEntry{"USAGE", cmd.UseLine()})
if len(coreCmds) > 0 {
helpEntries = append(helpEntries, helpEntry{"CORE COMMANDS", strings.Join(coreCmds, "\n")})
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func setDefaults(v *viper.Viper) {
v.SetDefault(constants.ConfigSpace, "")
v.SetDefault(constants.ConfigNoPrompt, false)
// v.SetDefault(constants.ConfigProxyUrl, "")
// v.SetDefault(constants.ConfigShowOctopus, true)
v.SetDefault(constants.ConfigShowOctopus, true)
v.SetDefault(constants.ConfigOutputFormat, "table")

if runtime.GOOS == "windows" {
Expand Down
23 changes: 21 additions & 2 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const (
ConfigSpace = "Space"
ConfigNoPrompt = "NoPrompt"
// ConfigProxyUrl = "ProxyUrl"
ConfigEditor = "Editor"
// ConfigShowOctopus = "ShowOctopus"
ConfigEditor = "Editor"
ConfigShowOctopus = "ShowOctopus"
ConfigOutputFormat = "OutputFormat"
)

Expand All @@ -51,10 +51,29 @@ const (
NoDescription = "No description provided"
)

const OctopusLogo = ` &#BGGGGGGB#&
&GP%%%%%%%%%%%%%G&
&G%%%%%%%%%%%%%%%%%%P&
&%%%%%%%%%%%%%%%%%%%%%%#
%%%%%%%%%%%%%%%%%%%%%%%%
#%%%%%%%%%%%%%%%%%%%%%%%%&
#%%%%%%%%%%%%%%%%%%%%%%%%&
P%%%%%%%%%%%%%%%%%%%%%%#
&%%%%%%%%%%%%%%%%%%%%%G
B%%%%%%%%%%%%%%%%%%%%#
P%%%%%%%%%%%%%%%%%%%%P
&P%%%%%%%%%%%%%%%%%%%%%%P#
#G%%%%P%%%%%%GP%%%%%%PP%%%%%PG&
&G%%%PB&#P%%%%G G%%%%P &P%%P#&&
&& G%%%%# &%%%%G #P%%#
&%%%G& G%%%B &&
&# BPB`

const (
PromptCreateNew = "<Create New>"
)


// IsProgrammaticOutputFormat tells you if it is acceptable for your command to
// print miscellaneous output to stdout, such as progress messages.
// If your command is capable of printing such things, you should check the output format
Expand Down

0 comments on commit 1953205

Please sign in to comment.