Skip to content

Commit 0c24377

Browse files
committed
Fix the bug with text alignment if colors are disabled
1 parent 5ecd2d5 commit 0c24377

5 files changed

Lines changed: 19 additions & 12 deletions

File tree

cli/cli.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,6 @@ func preConfigureUI() {
182182
}
183183
}
184184

185-
if !fsutil.IsCharacterDevice("/dev/stdout") && os.Getenv("FAKETTY") == "" {
186-
fmtc.DisableColors = true
187-
}
188-
189185
if os.Getenv("NO_COLOR") != "" {
190186
fmtc.DisableColors = true
191187
}

cli/details.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,19 @@ func printSimulationInfo(sim *sslscan.SIM, suites []*sslscan.ProtocolSuites) {
639639
}
640640

641641
if sim.Client.IsReference {
642-
fmtc.Printf(" %-29s {s}|{!} ", sim.Client.Name+" "+sim.Client.Version+" "+fmtc.Sprintf("{g}R"))
642+
fmtc.Printf(
643+
" %s {s}|{!} ",
644+
fmtutil.Align(fmtc.Sprintf(
645+
"%s %s {g}R{!}", sim.Client.Name, sim.Client.Version,
646+
), fmtutil.LEFT, 20),
647+
)
643648
} else {
644-
fmtc.Printf(" %-20s {s}|{!} ", sim.Client.Name+" "+sim.Client.Version)
649+
fmtc.Printf(
650+
" %s {s}|{!} ",
651+
fmtutil.Align(fmtc.Sprintf(
652+
"%s %s", sim.Client.Name, sim.Client.Version,
653+
), fmtutil.LEFT, 20),
654+
)
645655
}
646656

647657
switch protocolsNames[sim.ProtocolID] {

common/sslcli.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ fi
103103
%changelog
104104
* Thu Apr 27 2023 Anton Novojilov <andy@essentialkaos.com> - 2.7.5-0
105105
- Fixed the bug with showing the number of certificate validity days
106+
- Fixed the bug with text alignment if colors are disabled
106107
- Typos fixed
107108

108109
* Mon Mar 06 2023 Anton Novojilov <andy@essentialkaos.com> - 2.7.4-0

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ go 1.19
44

55
require (
66
github.com/essentialkaos/depsy v1.0.0
7-
github.com/essentialkaos/ek/v12 v12.64.1
7+
github.com/essentialkaos/ek/v12 v12.65.0
88
github.com/essentialkaos/sslscan/v13 v13.2.0
99
)
1010

1111
require (
1212
github.com/andybalholm/brotli v1.0.5 // indirect
1313
github.com/klauspost/compress v1.16.5 // indirect
1414
github.com/valyala/bytebufferpool v1.0.0 // indirect
15-
github.com/valyala/fasthttp v1.45.0 // indirect
15+
github.com/valyala/fasthttp v1.46.0 // indirect
1616
golang.org/x/sys v0.7.0 // indirect
1717
)

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHG
33
github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk=
44
github.com/essentialkaos/depsy v1.0.0 h1:FikBtTnNhk+xFO/hFr+CfiKs6QnA3wMD6tGL0XTEUkc=
55
github.com/essentialkaos/depsy v1.0.0/go.mod h1:XVsB2eVUonEzmLKQP3ig2P6v2+WcHVgJ10zm0JLqFMM=
6-
github.com/essentialkaos/ek/v12 v12.64.1 h1:XjIF4GHCgVIY0S0KEz8g1OrNrRoHGU+vAUXSYIKNIbI=
7-
github.com/essentialkaos/ek/v12 v12.64.1/go.mod h1:PFJckNu+x4mHqsjndUeYRDPgDgvZEgcjpy1RpCYtx4g=
6+
github.com/essentialkaos/ek/v12 v12.65.0 h1:OYs8HrVxzzG8CYW9s2wc6Ihfg+ZAnMGB94xzVEC+NMU=
7+
github.com/essentialkaos/ek/v12 v12.65.0/go.mod h1:PFJckNu+x4mHqsjndUeYRDPgDgvZEgcjpy1RpCYtx4g=
88
github.com/essentialkaos/sslscan/v13 v13.2.0 h1:myHahuvrPkjIL9PKGeaBz+8NglpWE55WsvRgQ1QDS8A=
99
github.com/essentialkaos/sslscan/v13 v13.2.0/go.mod h1:8gPBJnA41juOmUsqGol0dJysXJ1+baXNgGqGp0AYvZs=
1010
github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI=
@@ -14,7 +14,7 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
1414
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
1515
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
1616
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
17-
github.com/valyala/fasthttp v1.45.0 h1:zPkkzpIn8tdHZUrVa6PzYd0i5verqiPSkgTd3bSUcpA=
18-
github.com/valyala/fasthttp v1.45.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA=
17+
github.com/valyala/fasthttp v1.46.0 h1:6ZRhrFg8zBXTRYY6vdzbFhqsBd7FVv123pV2m9V87U4=
18+
github.com/valyala/fasthttp v1.46.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA=
1919
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
2020
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

0 commit comments

Comments
 (0)