2018-02-07 21:44:54 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2018-02-09 15:30:02 +00:00
|
|
|
"fmt"
|
2018-02-07 21:44:54 +00:00
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/jessevdk/go-flags"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Options struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
var options Options
|
|
|
|
|
|
|
|
var parser = flags.NewParser(&options, flags.Default)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
if _, err := parser.Parse(); err != nil {
|
|
|
|
if flagsErr, ok := err.(*flags.Error); ok && flagsErr.Type == flags.ErrHelp {
|
|
|
|
os.Exit(0)
|
|
|
|
} else {
|
2018-02-09 15:30:02 +00:00
|
|
|
fmt.Fprintln(os.Stdout)
|
|
|
|
parser.WriteHelp(os.Stdout)
|
2018-02-07 21:44:54 +00:00
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|