mirror of https://github.com/docker/buildx.git
ensure call aliases also work formatting parameters
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
ef4a165e48
commit
0902294e1a
|
@ -12,17 +12,10 @@ import (
|
||||||
const defaultPrintFunc = "build"
|
const defaultPrintFunc = "build"
|
||||||
|
|
||||||
func ParsePrintFunc(str string) (*controllerapi.PrintFunc, error) {
|
func ParsePrintFunc(str string) (*controllerapi.PrintFunc, error) {
|
||||||
if str == "" || str == defaultPrintFunc {
|
if str == "" {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// "check" has been added as an alias for "lint",
|
|
||||||
// in order to maintain backwards compatibility
|
|
||||||
// we need to convert it.
|
|
||||||
if str == "check" {
|
|
||||||
str = "lint"
|
|
||||||
}
|
|
||||||
|
|
||||||
csvReader := csv.NewReader(strings.NewReader(str))
|
csvReader := csv.NewReader(strings.NewReader(str))
|
||||||
fields, err := csvReader.Read()
|
fields, err := csvReader.Read()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -51,5 +44,17 @@ func ParsePrintFunc(str string) (*controllerapi.PrintFunc, error) {
|
||||||
f.Name = field
|
f.Name = field
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// "check" has been added as an alias for "lint",
|
||||||
|
// in order to maintain backwards compatibility
|
||||||
|
// we need to convert it.
|
||||||
|
if f.Name == "check" {
|
||||||
|
f.Name = "lint"
|
||||||
|
}
|
||||||
|
|
||||||
|
if f.Name == defaultPrintFunc {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
return f, nil
|
return f, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue