Skip to content

Commit

Permalink
ben message tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
gabemontero committed Jan 26, 2018
1 parent 533e96a commit 816b5a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/oc/cli/cmd/newapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ func handleError(err error, baseName, commandName, commandPath string, config *n
fmt.Fprint(buf, group.suggestion)
}
if len(config.ArgumentClassificationErrors) > 0 && len(groups) > 0 {
fmt.Fprintf(buf, "\nFor further assistance, %s classification of the argument types resulted in the following:\n", commandName)
fmt.Fprintf(buf, "\nClassification of arguments is the following:\n")
for _, classErr := range config.ArgumentClassificationErrors {
fmt.Fprintf(buf, fmt.Sprintf("\n%s: %v\n", classErr.Key, classErr.Value))
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/oc/generate/app/cmd/newapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func (c *AppConfig) tryToAddTemplateArguments(s string) bool {
// AddArguments converts command line arguments into the appropriate bucket based on what they look like
func (c *AppConfig) AddArguments(args []string) []string {
unknown := []string{}
winnerFmt := "The argument %s passed the %s classification tests"
winnerFmt := "Argument %s was classified as %s"
c.ArgumentClassificationErrors = []ArgumentClassificationError{}
for _, s := range args {
if len(s) == 0 {
Expand All @@ -322,14 +322,14 @@ func (c *AppConfig) AddArguments(args []string) []string {

switch {
case c.tryToAddEnvironmentArguments(s):
c.ArgumentClassificationWinner = fmt.Sprintf(winnerFmt, s, "environment")
c.ArgumentClassificationWinner = fmt.Sprintf(winnerFmt, s, "an environment value")
case c.tryToAddSourceArguments(s):
c.ArgumentClassificationWinner = fmt.Sprintf(winnerFmt, s, "source")
c.ArgumentClassificationWinner = fmt.Sprintf(winnerFmt, s, "a source repository")
case c.tryToAddTemplateArguments(s):
c.ArgumentClassificationWinner = fmt.Sprintf(winnerFmt, s, "template")
c.ArgumentClassificationWinner = fmt.Sprintf(winnerFmt, s, "a template")
case c.tryToAddComponentArguments(s):
// NOTE, component argument classification currently is the most lenient, so we save it for the end
c.ArgumentClassificationWinner = fmt.Sprintf(winnerFmt, s, "component")
c.ArgumentClassificationWinner = fmt.Sprintf(winnerFmt, s, " an image reference with optionally a source repository")
default:
glog.V(2).Infof("treating %s as unknown\n", s)
unknown = append(unknown, s)
Expand Down

0 comments on commit 816b5a7

Please sign in to comment.