diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | main.go | 14 |
3 files changed, 16 insertions, 7 deletions
@@ -1,2 +1,4 @@ bin/ vendor/ + +index.md @@ -20,3 +20,10 @@ install: 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 @@ -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 @@ func run( output string, templateType string, templateFile string, - ) error { tarStream, err := fechIndex(url) @@ -68,10 +67,11 @@ func run( } } - 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() |