go(run.go): consolidate flag names
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e7be74d1eb
commit
afcd7c4198
12
run.go
12
run.go
@ -60,12 +60,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.`
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
host = flag.String("host", "unset", "host address to listen on")
|
hostFlag = flag.String("host", "unset", "host address to listen on")
|
||||||
port = flag.Int("port", 0, "TCP port to listen on")
|
portFlag = flag.Int("port", 0, "TCP port to listen on")
|
||||||
configFlag = flag.String("config", "config.dhall", "Default path of the config file")
|
configFlag = flag.String("config", "config.dhall", "Default path of the config file")
|
||||||
configIsPathFlag = flag.Bool("configIsPath", true, "Whether the provided config is path or raw config")
|
configIsPathFlag = flag.Bool("configIsPath", true, "Whether the provided config is path or raw config")
|
||||||
devel = flag.Bool("devel", false, "Run the application in dev mode, connect to a local browser-sync instance for hot-reloading")
|
develFlag = flag.Bool("devel", false, "Run the application in dev mode, connect to a local browser-sync instance for hot-reloading")
|
||||||
license = flag.Bool("license", false, "Print licensing information and exit")
|
licenseFlag = flag.Bool("license", false, "Print licensing information and exit")
|
||||||
versionFlag = flag.Bool("version", false, "Print version and exit")
|
versionFlag = flag.Bool("version", false, "Print version and exit")
|
||||||
importFlag = flag.String("import", "", "Path to import breach data from")
|
importFlag = flag.String("import", "", "Path to import breach data from")
|
||||||
version = "dev"
|
version = "dev"
|
||||||
@ -78,7 +78,7 @@ var (
|
|||||||
func run() error { //nolint:gocognit
|
func run() error { //nolint:gocognit
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if *license {
|
if *licenseFlag {
|
||||||
fmt.Fprintln(os.Stderr, licenseHeader)
|
fmt.Fprintln(os.Stderr, licenseHeader)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -129,7 +129,7 @@ func run() error { //nolint:gocognit
|
|||||||
setting := settings.New()
|
setting := settings.New()
|
||||||
|
|
||||||
setting.Consolidate(
|
setting.Consolidate(
|
||||||
conf, host, port, devel, version,
|
conf, hostFlag, portFlag, develFlag, version,
|
||||||
)
|
)
|
||||||
|
|
||||||
// expected connstring form for "github.com/xiaoqidun/entps":
|
// expected connstring form for "github.com/xiaoqidun/entps":
|
||||||
|
Loading…
Reference in New Issue
Block a user