diff --git a/.gitignore b/.gitignore
index f331ccd56052fda427b7b1b8b581d13c01147937..7712b56b5dc3ab2a10a6ab6f40ebb695ce7261d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
bin/
vendor/
+
+index.md
diff --git a/Makefile b/Makefile
index e5bf8e969c0ba1a495a15f815588997245e31e15..6fafba4ebc4d223483e478afff481cb62aa430e5 100644
--- a/Makefile
+++ b/Makefile
@@ -20,3 +20,10 @@ install -Dm755 $(OUT) $(BINDIR)/$(BIN)
compress:
upx --best --ultra-brute $(OUT)
+
+check: build
+ $(OUT) \
+ -f example.md \
+ -t text \
+ -u https://alpine.mirror.wearetriple.com/v3.18/main/x86_64/APKINDEX.tar.gz \
+ -o index.txt
diff --git a/main.go b/main.go
index 3f3f40cb1179c88d3381c9dfc48a7d929653e8ee..2231f97c2a1f8599a0fccba5350a0b8c76bf2a8a 100644
--- a/main.go
+++ b/main.go
@@ -18,8 +18,8 @@ func main() {
var (
url = flag.StringP("url", "u", "", "Url to the APKINDEX.tar.gz")
output = flag.StringP("output", "o", "index.md", "Output path")
- templateType = flag.StringP("template-type", "p", "text", "Template system to be used, options: html, text")
- templateFile = flag.StringP("template-file", "t", "text", "Template file to be used")
+ templateType = flag.StringP("template-type", "t", "text", "Template system to be used, options: html, text")
+ templateFile = flag.StringP("template-file", "f", "text", "Template file to be used")
)
flag.Parse()
@@ -40,7 +40,6 @@ url string,
output string,
templateType string,
templateFile string,
-
) error {
tarStream, err := fechIndex(url)
@@ -68,10 +67,11 @@ break
}
}
- s := bufio.NewScanner(tr)
-
- entries := make([]*Entry, 0)
- lines := make([]string, 0)
+ var (
+ s = bufio.NewScanner(tr)
+ entries = make([]*Entry, 0)
+ lines = make([]string, 0)
+ )
for s.Scan() {
l := s.Text()