https://github.com/yudai/hata
Hata is a structure oriented command line argument parser for Go
https://github.com/yudai/hata
Last synced: 6 months ago
JSON representation
Hata is a structure oriented command line argument parser for Go
- Host: GitHub
- URL: https://github.com/yudai/hata
- Owner: yudai
- Created: 2015-10-19T09:41:38.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-26T09:56:14.000Z (almost 10 years ago)
- Last Synced: 2025-03-24T07:26:43.302Z (7 months ago)
- Language: Go
- Homepage:
- Size: 148 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🏁 Hata - CLI Flags with Structures
Maybe something like below will be implemented.
```go
package mainimport (
"github.com/yudai/hata"
"os"
)type Options struct {
ConfigFile string `short:"c", long:"config", desc:"Config file path"`
User string `short:"u", desc:"User name"`
Timeout uint `short:"t", desc:"Timeout (seconds)"`
}func main() {
defaults := Options{
ConfigFile: "/etc/foo/bar",
User: "admin",
Timeout: 30,
}c := hata.New(defaults)
c.Parse(os.Args)
}```