github.com/loafoe/cli@v7.1.0+incompatible/cf/requirements/unsupported_legacy_flag.go (about)

     1  package requirements
     2  
     3  import (
     4  	"errors"
     5  	"strings"
     6  
     7  	. "code.cloudfoundry.org/cli/cf/i18n"
     8  )
     9  
    10  type UnsupportedLegacyFlagRequirement struct {
    11  	flags []string
    12  }
    13  
    14  func NewUnsupportedLegacyFlagRequirement(flags []string) UnsupportedLegacyFlagRequirement {
    15  	return UnsupportedLegacyFlagRequirement{
    16  		flags: flags,
    17  	}
    18  }
    19  
    20  func (r UnsupportedLegacyFlagRequirement) Execute() error {
    21  	return errors.New(T(
    22  		"The following flags cannot be used with deprecated usage: {{.flags}}",
    23  		map[string]interface{}{
    24  			"flags": strings.Join(r.flags, ", "),
    25  		}))
    26  }