diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-09-03 14:34:32 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-09-03 14:34:32 +0200 |
commit | 41f860a791c9869ce68d55aeb97cc07d7f47c09c (patch) | |
tree | 3b046b39479b2a523cae4d52abeb407524acf0be | |
parent | 2b060e55e538a70f0edcd25d9a4c491a03d50149 (diff) | |
download | apkdoc-41f860a791c9869ce68d55aeb97cc07d7f47c09c.tar.gz apkdoc-41f860a791c9869ce68d55aeb97cc07d7f47c09c.tar.bz2 apkdoc-41f860a791c9869ce68d55aeb97cc07d7f47c09c.zip |
ref: Move to pflag
Don't like default single `-` param.
-rw-r--r-- | go.mod | 6 | ||||
-rw-r--r-- | go.sum | 2 | ||||
-rw-r--r-- | main.go | 8 |
3 files changed, 10 insertions, 6 deletions
@@ -3,6 +3,8 @@ module git.sr.ht/~gabrielgio/apkdoc go 1.20 require ( - github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/quicktemplate v1.7.0 // indirect + github.com/spf13/pflag v1.0.5 + github.com/valyala/quicktemplate v1.7.0 ) + +require github.com/valyala/bytebufferpool v1.0.0 // indirect @@ -3,6 +3,8 @@ github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHG github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= @@ -5,13 +5,13 @@ import ( "bufio" "compress/gzip" "errors" - "flag" "io" "net/http" "os" "git.sr.ht/~gabrielgio/apkdoc/parser" "git.sr.ht/~gabrielgio/apkdoc/templates" + flag "github.com/spf13/pflag" ) func fechIndex(url string) (io.ReadCloser, error) { @@ -28,9 +28,9 @@ func fechIndex(url string) (io.ReadCloser, error) { } func main() { - url := flag.String("url", "", "Url to the APKINDEX.tar.gz") - output := flag.String("output", "index.md", "Output path") - repositoryFormat := flag.String("repository-format", "https://git.sr.ht/~gabrielgio/apkbuilds/tree/%s/item/apks/%s", "Template to build repository link") + url := flag.StringP("url", "u", "", "Url to the APKINDEX.tar.gz") + output := flag.StringP("output", "o", "index.md", "Output path") + repositoryFormat := flag.StringP("repository-format", "f", "https://git.sr.ht/~gabrielgio/apkbuilds/tree/%s/item/apks/%s", "Template to build repository link") flag.Parse() tarStream, err := fechIndex(*url) |