github.com/cloudfoundry/cli@v7.1.0+incompatible/command/translatableerror/argument_combination_error.go (about)

     1  package translatableerror
     2  
     3  import "strings"
     4  
     5  // ArgumentCombinationError represent an error caused by using two command line
     6  // arguments that cannot be used together.
     7  type ArgumentCombinationError struct {
     8  	Args []string
     9  }
    10  
    11  func (ArgumentCombinationError) DisplayUsage() {}
    12  
    13  func (ArgumentCombinationError) Error() string {
    14  	return "Incorrect Usage: The following arguments cannot be used together: {{.Args}}"
    15  }
    16  
    17  func (e ArgumentCombinationError) Translate(translate func(string, ...interface{}) string) string {
    18  	return translate(e.Error(), map[string]interface{}{
    19  		"Args": strings.Join(e.Args, ", "),
    20  	})
    21  }