From e027552f4e0ead9ceab64fd9977866eaa96a0a41 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Sat, 9 Feb 2019 12:47:48 +0300 Subject: [PATCH 1/2] Fixed compatibility with the latest version of ek package --- cli/cli.go | 16 +++++++--------- common/sslcli.spec | 5 ++++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index 26ad1ce..8b27dab 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -29,7 +29,7 @@ import ( const ( APP = "SSLScan Client" - VER = "2.0.0" + VER = "2.0.1" DESC = "Command-line client for the SSL Labs API" ) @@ -245,10 +245,8 @@ func check(host string) string { IgnoreMismatch: options.GetB(OPT_IGNORE_MISMATCH), } - fmtc.Printf("{*}%s{!} → ", host) - if !options.GetB(OPT_DETAILED) { - fmtc.TPrintf("{s}Preparing for tests…{!}") + fmtc.TPrintf("{*}%s{!} → {s}Preparing for tests…{!}", host) } ap, err := api.Analyze(host, params) @@ -262,12 +260,12 @@ func check(host string) string { info, err = ap.Info(false) if err != nil { - fmtc.TPrintf("{r}%v{!}\n", err) + fmtc.Printf("{*}%s{!} → {r}%v{!}\n", host, err) return "Err" } if info.Status == sslscan.STATUS_ERROR { - fmtc.TPrintf("{r}%s{!}\n", info.StatusMessage) + fmtc.Printf("{*}%s{!} → {r}%s{!}\n", host, info.StatusMessage) return "Err" } else if info.Status == sslscan.STATUS_READY { break @@ -277,7 +275,7 @@ func check(host string) string { message := getStatusInProgress(info.Endpoints) if message != "" { - fmtc.TPrintf("{s}%s…{!}", message) + fmtc.TPrintf("{*}%s{!} → {s}%s…{!}", host, message) } } @@ -289,9 +287,9 @@ func check(host string) string { } if len(info.Endpoints) == 1 { - fmtc.TPrintln(getColoredGrade(info.Endpoints[0].Grade)) + fmtc.TPrintf("{*}%s{!} → "+getColoredGrade(info.Endpoints[0].Grade)+"\n", host) } else { - fmtc.TPrintln(getColoredGrades(info.Endpoints)) + fmtc.TPrintf("{*}%s{!} → "+getColoredGrades(info.Endpoints)+"\n", host) } if options.GetB(OPT_DETAILED) { diff --git a/common/sslcli.spec b/common/sslcli.spec index 128b928..3807c3f 100644 --- a/common/sslcli.spec +++ b/common/sslcli.spec @@ -44,7 +44,7 @@ Summary: Pretty awesome command-line client for public SSLLabs API Name: sslcli -Version: 2.0.0 +Version: 2.0.1 Release: 0%{?dist} Group: Applications/System License: EKOL @@ -92,6 +92,9 @@ rm -rf %{buildroot} ################################################################################ %changelog +* Sat Feb 09 2019 Anton Novojilov - 2.0.1-0 +- Fixed compatibility with the latest version of ek package + * Tue Jan 29 2019 Anton Novojilov - 2.0.0-0 - Improved UI - Info about HTTP transactions From 3857c4fea031271f4ef37ddbe564eea25f8591c3 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Sun, 10 Feb 2019 02:36:20 +0300 Subject: [PATCH 2/2] UI fixes --- cli/cli.go | 11 +++++------ cli/details.go | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index 8b27dab..c7ed75a 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -197,6 +197,7 @@ func process(args []string) { checksInfo = append(checksInfo, checkInfo) default: grade = check(host) + fmtc.NewLine() } switch { @@ -245,14 +246,12 @@ func check(host string) string { IgnoreMismatch: options.GetB(OPT_IGNORE_MISMATCH), } - if !options.GetB(OPT_DETAILED) { - fmtc.TPrintf("{*}%s{!} → {s}Preparing for tests…{!}", host) - } + fmtc.TPrintf("{*}%s{!} → {s}Preparing for tests…{!}", host) ap, err := api.Analyze(host, params) if err != nil { - fmtc.Printf("{r}%v{!}\n", err) + fmtc.TPrintf("{*}%s{!} → {r}%v{!}\n", host, err) return "T" } @@ -260,12 +259,12 @@ func check(host string) string { info, err = ap.Info(false) if err != nil { - fmtc.Printf("{*}%s{!} → {r}%v{!}\n", host, err) + fmtc.TPrintf("{*}%s{!} → {r}%v{!}\n", host, err) return "Err" } if info.Status == sslscan.STATUS_ERROR { - fmtc.Printf("{*}%s{!} → {r}%s{!}\n", host, info.StatusMessage) + fmtc.TPrintf("{*}%s{!} → {r}%s{!}\n", host, info.StatusMessage) return "Err" } else if info.Status == sslscan.STATUS_READY { break diff --git a/cli/details.go b/cli/details.go index c23f350..0ffc7f6 100644 --- a/cli/details.go +++ b/cli/details.go @@ -76,8 +76,6 @@ func printDetailedInfo(ap *sslscan.AnalyzeProgress) { fmtc.Printf("\n{c*} %s {!*}#%d (%s){!}\n", info.Host, index+1, endpoint.IPAdress) printDetailedEndpointInfo(endpoint, info.Certs) } - - fmtc.NewLine() } // printCertificateInfo prints info about server certificate