File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -2460,3 +2460,18 @@ func TestApplyCalledOnce(t *testing.T) {
2460
2460
err = kctx .Run ()
2461
2461
assert .NoError (t , err )
2462
2462
}
2463
+
2464
+ func TestCustomTypeNoEllipsis (t * testing.T ) {
2465
+ type CLI struct {
2466
+ Flag []byte `type:"existingfile"`
2467
+ }
2468
+ var cli CLI
2469
+ p := mustNew (t , & cli , kong .Exit (func (int ) {}))
2470
+ w := & strings.Builder {}
2471
+ p .Stderr = w
2472
+ p .Stdout = w
2473
+ _ , err := p .Parse ([]string {"--help" })
2474
+ assert .NoError (t , err )
2475
+ help := w .String ()
2476
+ assert .NotContains (t , help , "..." )
2477
+ }
Original file line number Diff line number Diff line change @@ -433,7 +433,7 @@ func (f *Flag) FormatPlaceHolder() string {
433
433
return placeholderHelper .PlaceHolder (f )
434
434
}
435
435
tail := ""
436
- if f .Value .IsSlice () && f .Value .Tag .Sep != - 1 {
436
+ if f .Value .IsSlice () && f .Value .Tag .Sep != - 1 && f . Tag . Type == "" {
437
437
tail += string (f .Value .Tag .Sep ) + "..."
438
438
}
439
439
if f .PlaceHolder != "" {
@@ -446,7 +446,7 @@ func (f *Flag) FormatPlaceHolder() string {
446
446
return f .Default + tail
447
447
}
448
448
if f .Value .IsMap () {
449
- if f .Value .Tag .MapSep != - 1 {
449
+ if f .Value .Tag .MapSep != - 1 && f . Tag . Type == "" {
450
450
tail = string (f .Value .Tag .MapSep ) + "..."
451
451
}
452
452
return "KEY=VALUE" + tail
You can’t perform that action at this time.
0 commit comments