fix: match column show attribute character to 'S' (#3191)
* fix: match column show attribute character to 'S' * fix: recover failing lintmine
parent
08b8efa617
commit
4a829613a7
|
|
@ -14,7 +14,7 @@ import (
|
||||||
"k8s.io/kubectl/pkg/cmd/get"
|
"k8s.io/kubectl/pkg/cmd/get"
|
||||||
)
|
)
|
||||||
|
|
||||||
var fullRX = regexp.MustCompile(`^([\w\s%\/-]+)\:?([\w\d\S\W]*?)\|?([N|T|W|V|R|L|H]{0,3})$`)
|
var fullRX = regexp.MustCompile(`^([\w\s%\/-]+)\:?([\w\d\S\W]*?)\|?([N|T|W|S|L|R|H]{0,3})$`)
|
||||||
|
|
||||||
type colAttr byte
|
type colAttr byte
|
||||||
|
|
||||||
|
|
@ -22,7 +22,7 @@ const (
|
||||||
number colAttr = 'N'
|
number colAttr = 'N'
|
||||||
age colAttr = 'T'
|
age colAttr = 'T'
|
||||||
wide colAttr = 'W'
|
wide colAttr = 'W'
|
||||||
show colAttr = 'V'
|
show colAttr = 'S'
|
||||||
alignLeft colAttr = 'L'
|
alignLeft colAttr = 'L'
|
||||||
alignRight colAttr = 'R'
|
alignRight colAttr = 'R'
|
||||||
hide colAttr = 'H'
|
hide colAttr = 'H'
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,18 @@ func TestCustCol_parse(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"plain-show": {
|
||||||
|
s: "fred|S",
|
||||||
|
e: colDef{
|
||||||
|
name: "fred",
|
||||||
|
idx: -1,
|
||||||
|
colAttrs: colAttrs{
|
||||||
|
align: tview.AlignLeft,
|
||||||
|
show: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
"age": {
|
"age": {
|
||||||
s: "AGE|TR",
|
s: "AGE|TR",
|
||||||
e: colDef{
|
e: colDef{
|
||||||
|
|
@ -198,7 +210,7 @@ func TestCustCol_parse(t *testing.T) {
|
||||||
},
|
},
|
||||||
|
|
||||||
"toast-no-name": {
|
"toast-no-name": {
|
||||||
s: `:.metadata.name.fred|TW`,
|
s: ":.metadata.name.fred|TW",
|
||||||
err: errors.New(`invalid column definition ":.metadata.name.fred|TW"`),
|
err: errors.New(`invalid column definition ":.metadata.name.fred|TW"`),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue