Skip to content

Commit e9a26cb

Browse files
committed
doc: added README.md
1 parent d0b40a1 commit e9a26cb

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

README.md

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# [cliargs][repo-url] [![Go Reference][pkg-dev-img]][pkg-dev-url] [![CI Status][ci-img]][ci-url] [![MIT License][mit-img]][mit-url]
2+
3+
A library to parse command line arguments for Golang application.
4+
5+
This library provides the following functionalities:
6+
7+
- Supports [POSIX][posix-args] & [GNU][gnu-args] like short and long options.
8+
- This library supports `--` option.
9+
- This library doesn't support numeric short option.
10+
- This library supports not `-ofoo` but `-o=foo` as an alternative to `-o foo` for short option.
11+
- Supports parsing with option configurations.
12+
- Supports parsing with a struct which stores option values and has struct tags of fields.
13+
- Is able to parse command line arguments including sub commands.
14+
- Generates help text from option configurations.
15+
16+
17+
## Import this package
18+
19+
```
20+
import "github.com/sttk/cliargs"
21+
```
22+
23+
## Usage
24+
25+
The usage of this library is described on the overview in the go package document.
26+
27+
See https://pkg.go.dev/github.com/sttk/cliargs#pkg-overview
28+
29+
30+
## Supporting Go versions
31+
32+
This library supports Go 1.18 or later.
33+
34+
### Actual test results for each Go version:
35+
36+
```sh
37+
% gvm-fav
38+
Now using version go1.18.10
39+
go version go1.18.10 darwin/amd64
40+
ok github.com/sttk/cliargs 0.913s coverage: 97.6% of statements
41+
ok github.com/sttk/cliargs/errors 1.053s coverage: 100.0% of statements
42+
ok github.com/sttk/cliargs/validators 0.538s coverage: 100.0% of statements
43+
44+
Now using version go1.19.13
45+
go version go1.19.13 darwin/amd64
46+
ok github.com/sttk/cliargs 0.895s coverage: 97.6% of statements
47+
ok github.com/sttk/cliargs/errors 1.034s coverage: 100.0% of statements
48+
ok github.com/sttk/cliargs/validators 0.541s coverage: 100.0% of statements
49+
50+
Now using version go1.20.14
51+
go version go1.20.14 darwin/amd64
52+
ok github.com/sttk/cliargs 0.551s coverage: 97.6% of statements
53+
ok github.com/sttk/cliargs/errors 1.054s coverage: 100.0% of statements
54+
ok github.com/sttk/cliargs/validators 1.568s coverage: 100.0% of statements
55+
56+
Now using version go1.21.13
57+
go version go1.21.13 darwin/amd64
58+
ok github.com/sttk/cliargs 0.560s coverage: 97.6% of statements
59+
ok github.com/sttk/cliargs/errors 1.073s coverage: 100.0% of statements
60+
ok github.com/sttk/cliargs/validators 1.587s coverage: 100.0% of statements
61+
62+
Now using version go1.22.6
63+
go version go1.22.6 darwin/amd64
64+
ok github.com/sttk/cliargs 0.555s coverage: 97.6% of statements
65+
ok github.com/sttk/cliargs/errors 1.058s coverage: 100.0% of statements
66+
ok github.com/sttk/cliargs/validators 1.583s coverage: 100.0% of statements
67+
68+
Back to go1.22.6
69+
Now using version go1.22.6
70+
```
71+
72+
## License
73+
74+
Copyright (C) 2023-2024 Takayuki Sato
75+
76+
This program is free software under MIT License.<br>
77+
See the file LICENSE in this distribution for more details.
78+
79+
80+
[repo-url]: https://github.com/sttk/cliargs-go
81+
[pkg-dev-img]: https://pkg.go.dev/badge/github.com/sttk/cliargs.svg
82+
[pkg-dev-url]: https://pkg.go.dev/github.com/sttk/cliargs
83+
[ci-img]: https://github.com/sttk/cliargs-go/actions/workflows/go.yml/badge.svg?branch=main
84+
[ci-url]: https://github.com/sttk/cliargs-go/actions
85+
[mit-img]: https://img.shields.io/badge/license-MIT-green.svg
86+
[mit-url]: https://opensource.org/licenses/MIT
87+
88+
[posix-args]: https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html#Argument-Syntax
89+
[gnu-args]: https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html

0 commit comments

Comments
 (0)