2023-01-29 10:54:56 +00:00
|
|
|
package shared
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
|
2023-02-23 17:49:45 +00:00
|
|
|
"gh.tarampamp.am/error-pages/internal/env"
|
2023-01-29 10:54:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var ConfigFileFlag = &cli.StringFlag{ //nolint:gochecknoglobals
|
|
|
|
Name: "config-file",
|
|
|
|
Aliases: []string{"c"},
|
|
|
|
Usage: "path to the config file (yaml)",
|
|
|
|
Value: "./error-pages.yml",
|
|
|
|
EnvVars: []string{env.ConfigFilePath.String()},
|
|
|
|
}
|
|
|
|
|
|
|
|
var ListenAddrFlag = &cli.StringFlag{ //nolint:gochecknoglobals
|
|
|
|
Name: "listen",
|
|
|
|
Aliases: []string{"l"},
|
2023-04-21 12:33:33 +00:00
|
|
|
Usage: "IP (v4 or v6) address to Listen on",
|
2023-01-29 10:54:56 +00:00
|
|
|
Value: "0.0.0.0",
|
|
|
|
EnvVars: []string{env.ListenAddr.String()},
|
|
|
|
}
|
|
|
|
|
|
|
|
var ListenPortFlag = &cli.UintFlag{ //nolint:gochecknoglobals
|
|
|
|
Name: "port",
|
|
|
|
Aliases: []string{"p"},
|
|
|
|
Usage: "TCP port number",
|
|
|
|
Value: 8080, //nolint:gomnd
|
|
|
|
EnvVars: []string{env.ListenPort.String()},
|
|
|
|
}
|