Skip to content

Commit 0004cc8

Browse files
authored
Merge pull request #64 from essentialkaos/develop
Version 2.7.0
2 parents 5ca6978 + fccb609 commit 0004cc8

6 files changed

Lines changed: 78 additions & 38 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
################################################################################
22

3-
# This Makefile generated by GoMakeGen 1.3.0 using next command:
3+
# This Makefile generated by GoMakeGen 1.3.2 using next command:
44
# gomakegen .
55
#
66
# More info: https://kaos.sh/gomakegen
@@ -28,7 +28,7 @@ git-config: ## Configure git redirects for stable import path services
2828

2929
deps: git-config ## Download dependencies
3030
go get -d -v pkg.re/essentialkaos/ek.v12
31-
go get -d -v pkg.re/essentialkaos/sslscan.v12
31+
go get -d -v pkg.re/essentialkaos/sslscan.v13
3232

3333
fmt: ## Format source code with gofmt
3434
find . -name "*.go" -exec gofmt -s -w {} \;
@@ -44,6 +44,6 @@ help: ## Show this info
4444
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
4545
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-12s\033[0m %s\n", $$1, $$2}'
4646
@echo -e ''
47-
@echo -e '\033[90mGenerated by GoMakeGen 1.3.0\033[0m\n'
47+
@echo -e '\033[90mGenerated by GoMakeGen 1.3.2\033[0m\n'
4848

4949
################################################################################

cli/cli.go

Lines changed: 52 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package cli
22

33
// ////////////////////////////////////////////////////////////////////////////////// //
44
// //
5-
// Copyright (c) 2020 ESSENTIAL KAOS //
5+
// Copyright (c) 2021 ESSENTIAL KAOS //
66
// Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> //
77
// //
88
// ////////////////////////////////////////////////////////////////////////////////// //
@@ -26,16 +26,17 @@ import (
2626
"pkg.re/essentialkaos/ek.v12/usage/completion/bash"
2727
"pkg.re/essentialkaos/ek.v12/usage/completion/fish"
2828
"pkg.re/essentialkaos/ek.v12/usage/completion/zsh"
29+
"pkg.re/essentialkaos/ek.v12/usage/man"
2930
"pkg.re/essentialkaos/ek.v12/usage/update"
3031

31-
"pkg.re/essentialkaos/sslscan.v12"
32+
"pkg.re/essentialkaos/sslscan.v13"
3233
)
3334

3435
// ////////////////////////////////////////////////////////////////////////////////// //
3536

3637
const (
3738
APP = "SSLScan Client"
38-
VER = "2.6.0"
39+
VER = "2.7.0"
3940
DESC = "Command-line client for the SSL Labs API"
4041
)
4142

@@ -53,7 +54,8 @@ const (
5354
OPT_HELP = "h:help"
5455
OPT_VER = "v:version"
5556

56-
OPT_COMPLETION = "completion"
57+
OPT_COMPLETION = "completion"
58+
OPT_GENERATE_MAN = "generate-man"
5759
)
5860

5961
const (
@@ -101,7 +103,8 @@ var optMap = options.Map{
101103
OPT_HELP: {Type: options.BOOL, Alias: "u:usage"},
102104
OPT_VER: {Type: options.BOOL, Alias: "ver"},
103105

104-
OPT_COMPLETION: {},
106+
OPT_COMPLETION: {},
107+
OPT_GENERATE_MAN: {Type: options.BOOL},
105108
}
106109

107110
var gradeNumMap = map[string]float64{
@@ -139,7 +142,11 @@ func Init() {
139142
}
140143

141144
if options.Has(OPT_COMPLETION) {
142-
genCompletion()
145+
os.Exit(genCompletion())
146+
}
147+
148+
if options.Has(OPT_GENERATE_MAN) {
149+
os.Exit(genMan())
143150
}
144151

145152
configureUI()
@@ -594,6 +601,41 @@ func showUsage() {
594601
genUsage().Render()
595602
}
596603

604+
// showAbout prints info about version
605+
func showAbout() {
606+
genAbout().Render()
607+
}
608+
609+
// genMan generates man page
610+
func genMan() int {
611+
fmt.Println(
612+
man.Generate(
613+
genUsage(),
614+
genAbout(),
615+
),
616+
)
617+
618+
return 0
619+
}
620+
621+
// genCompletion generates completion for different shells
622+
func genCompletion() int {
623+
info := genUsage()
624+
625+
switch options.GetS(OPT_COMPLETION) {
626+
case "bash":
627+
fmt.Printf(bash.Generate(info, "sslcli"))
628+
case "fish":
629+
fmt.Printf(fish.Generate(info, "sslcli"))
630+
case "zsh":
631+
fmt.Printf(zsh.Generate(info, optMap, "sslcli"))
632+
default:
633+
return 1
634+
}
635+
636+
return 0
637+
}
638+
597639
// genUsage generates usage info
598640
func genUsage() *usage.Info {
599641
info := usage.NewInfo("", "host…")
@@ -620,35 +662,17 @@ func genUsage() *usage.Info {
620662
return info
621663
}
622664

623-
// genCompletion generates completion for different shells
624-
func genCompletion() {
625-
info := genUsage()
626-
627-
switch options.GetS(OPT_COMPLETION) {
628-
case "bash":
629-
fmt.Printf(bash.Generate(info, "sslcli"))
630-
case "fish":
631-
fmt.Printf(fish.Generate(info, "sslcli"))
632-
case "zsh":
633-
fmt.Printf(zsh.Generate(info, optMap, "sslcli"))
634-
default:
635-
os.Exit(1)
636-
}
637-
638-
os.Exit(0)
639-
}
640-
641-
// showAbout prints info about version
642-
func showAbout() {
665+
// genAbout generates info about version
666+
func genAbout() *usage.About {
643667
about := &usage.About{
644668
App: APP,
645669
Version: VER,
646670
Desc: DESC,
647671
Year: 2009,
648-
Owner: "Essential Kaos",
672+
Owner: "ESSENTIAL KAOS",
649673
License: "Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0>",
650674
UpdateChecker: usage.UpdateChecker{"essentialkaos/sslcli", update.GitHubChecker},
651675
}
652676

653-
about.Render()
677+
return about
654678
}

cli/details.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package cli
22

33
// ////////////////////////////////////////////////////////////////////////////////// //
44
// //
5-
// Copyright (c) 2020 ESSENTIAL KAOS //
5+
// Copyright (c) 2021 ESSENTIAL KAOS //
66
// Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> //
77
// //
88
// ////////////////////////////////////////////////////////////////////////////////// //
@@ -19,7 +19,7 @@ import (
1919
"pkg.re/essentialkaos/ek.v12/strutil"
2020
"pkg.re/essentialkaos/ek.v12/timeutil"
2121

22-
"pkg.re/essentialkaos/sslscan.v12"
22+
"pkg.re/essentialkaos/sslscan.v13"
2323
)
2424

2525
// ////////////////////////////////////////////////////////////////////////////////// //

cli/encoder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package cli
22

33
// ////////////////////////////////////////////////////////////////////////////////// //
44
// //
5-
// Copyright (c) 2020 ESSENTIAL KAOS //
5+
// Copyright (c) 2021 ESSENTIAL KAOS //
66
// Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> //
77
// //
88
// ////////////////////////////////////////////////////////////////////////////////// //

common/sslcli.spec

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
################################################################################
66

7+
%global crc_check pushd ../SOURCES ; sha512sum -c %{SOURCE100} ; popd
8+
9+
################################################################################
10+
711
%define debug_package %{nil}
812

913
################################################################################
@@ -44,17 +48,19 @@
4448

4549
Summary: Pretty awesome command-line client for public SSLLabs API
4650
Name: sslcli
47-
Version: 2.6.0
51+
Version: 2.7.0
4852
Release: 0%{?dist}
4953
Group: Applications/System
5054
License: Apache License, Version 2.0
51-
URL: https://github.com/essentialkaos/sslcli
55+
URL: https://kaos.sh/sslcli
5256

5357
Source0: https://source.kaos.st/%{name}/%{name}-%{version}.tar.bz2
5458

59+
Source100: checksum.sha512
60+
5561
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
5662

57-
BuildRequires: golang >= 1.13
63+
BuildRequires: golang >= 1.14
5864

5965
Provides: %{name} = %{version}-%{release}
6066

@@ -66,6 +72,8 @@ Pretty awesome command-line client for public SSLLabs API.
6672
################################################################################
6773

6874
%prep
75+
%{crc_check}
76+
6977
%setup -q
7078

7179
%build
@@ -76,8 +84,12 @@ go build src/github.com/essentialkaos/sslcli/%{name}.go
7684
rm -rf %{buildroot}
7785

7886
install -dm 755 %{buildroot}%{_bindir}
87+
install -dm 755 %{buildroot}%{_mandir}/man1
88+
7989
install -pm 755 %{name} %{buildroot}%{_bindir}/
8090

91+
./%{name} --generate-man > %{buildroot}%{_mandir}/man1/%{name}.1
92+
8193
%clean
8294
rm -rf %{buildroot}
8395

@@ -114,11 +126,15 @@ fi
114126
%files
115127
%defattr(-,root,root,-)
116128
%doc LICENSE
129+
%{_mandir}/man1/%{name}.1.*
117130
%{_bindir}/%{name}
118131

119132
################################################################################
120133

121134
%changelog
135+
* Wed Jan 13 2021 Anton Novojilov <andy@essentialkaos.com> - 2.7.0-0
136+
- sslscan package updated to v13
137+
122138
* Wed May 06 2020 Anton Novojilov <andy@essentialkaos.com> - 2.6.0-0
123139
- Fixed panic if HPKPPolicy is empty
124140
- ek package updated to v12

sslcli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package main
44

55
// ////////////////////////////////////////////////////////////////////////////////// //
66
// //
7-
// Copyright (c) 2020 ESSENTIAL KAOS //
7+
// Copyright (c) 2021 ESSENTIAL KAOS //
88
// Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> //
99
// //
1010
// ////////////////////////////////////////////////////////////////////////////////// //

0 commit comments

Comments
 (0)