An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# 🏁 Hata - CLI Flags with Structures

Maybe something like below will be implemented.

```go
package main

import (
"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)
}

```