Documentation ¶
Index ¶
- Variables
- func Add() *cli.Command
- func Backup() *cli.Command
- func Check() *cli.Command
- func Clean() *cli.Command
- func Commands() []*cli.Command
- func Debug() *cli.Command
- func DefaultAction(c *cli.Context) error
- func Edit() *cli.Command
- func List() *cli.Command
- func Remove() *cli.Command
- func Restore() *cli.Command
- func Version(v, c, d string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( App = &cli.App{ Name: "goodhosts", Usage: "manage your hosts file goodly", Action: DefaultAction, Commands: append(Commands(), &cli.Command{ Name: "version", Usage: "", Aliases: []string{"v", "ver"}, Action: func(c *cli.Context) error { logrus.Infof(version) return nil }, }), Before: func(ctx *cli.Context) error { if ctx.Bool("debug") { logrus.SetLevel(logrus.DebugLevel) logrus.SetFormatter(&logrus.TextFormatter{}) } else { logrus.SetFormatter(&easy.Formatter{ LogFormat: "%msg%", }) } if ctx.Bool("quiet") { logrus.SetOutput(io.Discard) } return nil }, Flags: []cli.Flag{ &cli.StringFlag{ Name: "file", Aliases: []string{"f"}, Value: "", Usage: fmt.Sprintf("override the default hosts: %s", hostsfile.HostsFilePath), }, &cli.BoolFlag{ Name: "debug", Aliases: []string{"d"}, Usage: "Turn on verbose debug logging", }, &cli.BoolFlag{ Name: "quiet", Aliases: []string{"q"}, Usage: "Turn on off all logging", }, }, } )
Functions ¶
func DefaultAction ¶
func DefaultAction(c *cli.Context) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.