diff --git a/Makefile b/Makefile index 4239854..c9b1ed6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ################################################################################ -# This Makefile generated by GoMakeGen 1.3.0 using next command: +# This Makefile generated by GoMakeGen 1.3.2 using next command: # gomakegen . # # More info: https://kaos.sh/gomakegen @@ -28,7 +28,7 @@ git-config: ## Configure git redirects for stable import path services deps: git-config ## Download dependencies go get -d -v pkg.re/essentialkaos/ek.v12 - go get -d -v pkg.re/essentialkaos/sslscan.v12 + go get -d -v pkg.re/essentialkaos/sslscan.v13 fmt: ## Format source code with gofmt find . -name "*.go" -exec gofmt -s -w {} \; @@ -44,6 +44,6 @@ help: ## Show this info @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-12s\033[0m %s\n", $$1, $$2}' @echo -e '' - @echo -e '\033[90mGenerated by GoMakeGen 1.3.0\033[0m\n' + @echo -e '\033[90mGenerated by GoMakeGen 1.3.2\033[0m\n' ################################################################################ diff --git a/cli/cli.go b/cli/cli.go index 807b652..553dd00 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -2,7 +2,7 @@ package cli // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2021 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // @@ -26,16 +26,17 @@ import ( "pkg.re/essentialkaos/ek.v12/usage/completion/bash" "pkg.re/essentialkaos/ek.v12/usage/completion/fish" "pkg.re/essentialkaos/ek.v12/usage/completion/zsh" + "pkg.re/essentialkaos/ek.v12/usage/man" "pkg.re/essentialkaos/ek.v12/usage/update" - "pkg.re/essentialkaos/sslscan.v12" + "pkg.re/essentialkaos/sslscan.v13" ) // ////////////////////////////////////////////////////////////////////////////////// // const ( APP = "SSLScan Client" - VER = "2.6.0" + VER = "2.7.0" DESC = "Command-line client for the SSL Labs API" ) @@ -53,7 +54,8 @@ const ( OPT_HELP = "h:help" OPT_VER = "v:version" - OPT_COMPLETION = "completion" + OPT_COMPLETION = "completion" + OPT_GENERATE_MAN = "generate-man" ) const ( @@ -101,7 +103,8 @@ var optMap = options.Map{ OPT_HELP: {Type: options.BOOL, Alias: "u:usage"}, OPT_VER: {Type: options.BOOL, Alias: "ver"}, - OPT_COMPLETION: {}, + OPT_COMPLETION: {}, + OPT_GENERATE_MAN: {Type: options.BOOL}, } var gradeNumMap = map[string]float64{ @@ -139,7 +142,11 @@ func Init() { } if options.Has(OPT_COMPLETION) { - genCompletion() + os.Exit(genCompletion()) + } + + if options.Has(OPT_GENERATE_MAN) { + os.Exit(genMan()) } configureUI() @@ -594,6 +601,41 @@ func showUsage() { genUsage().Render() } +// showAbout prints info about version +func showAbout() { + genAbout().Render() +} + +// genMan generates man page +func genMan() int { + fmt.Println( + man.Generate( + genUsage(), + genAbout(), + ), + ) + + return 0 +} + +// genCompletion generates completion for different shells +func genCompletion() int { + info := genUsage() + + switch options.GetS(OPT_COMPLETION) { + case "bash": + fmt.Printf(bash.Generate(info, "sslcli")) + case "fish": + fmt.Printf(fish.Generate(info, "sslcli")) + case "zsh": + fmt.Printf(zsh.Generate(info, optMap, "sslcli")) + default: + return 1 + } + + return 0 +} + // genUsage generates usage info func genUsage() *usage.Info { info := usage.NewInfo("", "host…") @@ -620,35 +662,17 @@ func genUsage() *usage.Info { return info } -// genCompletion generates completion for different shells -func genCompletion() { - info := genUsage() - - switch options.GetS(OPT_COMPLETION) { - case "bash": - fmt.Printf(bash.Generate(info, "sslcli")) - case "fish": - fmt.Printf(fish.Generate(info, "sslcli")) - case "zsh": - fmt.Printf(zsh.Generate(info, optMap, "sslcli")) - default: - os.Exit(1) - } - - os.Exit(0) -} - -// showAbout prints info about version -func showAbout() { +// genAbout generates info about version +func genAbout() *usage.About { about := &usage.About{ App: APP, Version: VER, Desc: DESC, Year: 2009, - Owner: "Essential Kaos", + Owner: "ESSENTIAL KAOS", License: "Apache License, Version 2.0 ", UpdateChecker: usage.UpdateChecker{"essentialkaos/sslcli", update.GitHubChecker}, } - about.Render() + return about } diff --git a/cli/details.go b/cli/details.go index bb16774..413c654 100644 --- a/cli/details.go +++ b/cli/details.go @@ -2,7 +2,7 @@ package cli // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2021 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // @@ -19,7 +19,7 @@ import ( "pkg.re/essentialkaos/ek.v12/strutil" "pkg.re/essentialkaos/ek.v12/timeutil" - "pkg.re/essentialkaos/sslscan.v12" + "pkg.re/essentialkaos/sslscan.v13" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/cli/encoder.go b/cli/encoder.go index a052200..5e4ac6a 100644 --- a/cli/encoder.go +++ b/cli/encoder.go @@ -2,7 +2,7 @@ package cli // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2021 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/common/sslcli.spec b/common/sslcli.spec index a2ecebd..fe2ee74 100644 --- a/common/sslcli.spec +++ b/common/sslcli.spec @@ -4,6 +4,10 @@ ################################################################################ +%global crc_check pushd ../SOURCES ; sha512sum -c %{SOURCE100} ; popd + +################################################################################ + %define debug_package %{nil} ################################################################################ @@ -44,17 +48,19 @@ Summary: Pretty awesome command-line client for public SSLLabs API Name: sslcli -Version: 2.6.0 +Version: 2.7.0 Release: 0%{?dist} Group: Applications/System License: Apache License, Version 2.0 -URL: https://github.com/essentialkaos/sslcli +URL: https://kaos.sh/sslcli Source0: https://source.kaos.st/%{name}/%{name}-%{version}.tar.bz2 +Source100: checksum.sha512 + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: golang >= 1.13 +BuildRequires: golang >= 1.14 Provides: %{name} = %{version}-%{release} @@ -66,6 +72,8 @@ Pretty awesome command-line client for public SSLLabs API. ################################################################################ %prep +%{crc_check} + %setup -q %build @@ -76,8 +84,12 @@ go build src/github.com/essentialkaos/sslcli/%{name}.go rm -rf %{buildroot} install -dm 755 %{buildroot}%{_bindir} +install -dm 755 %{buildroot}%{_mandir}/man1 + install -pm 755 %{name} %{buildroot}%{_bindir}/ +./%{name} --generate-man > %{buildroot}%{_mandir}/man1/%{name}.1 + %clean rm -rf %{buildroot} @@ -114,11 +126,15 @@ fi %files %defattr(-,root,root,-) %doc LICENSE +%{_mandir}/man1/%{name}.1.* %{_bindir}/%{name} ################################################################################ %changelog +* Wed Jan 13 2021 Anton Novojilov - 2.7.0-0 +- sslscan package updated to v13 + * Wed May 06 2020 Anton Novojilov - 2.6.0-0 - Fixed panic if HPKPPolicy is empty - ek package updated to v12 diff --git a/sslcli.go b/sslcli.go index 464bd69..0456414 100644 --- a/sslcli.go +++ b/sslcli.go @@ -4,7 +4,7 @@ package main // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2021 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// //