go: mv flags to flag.go
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2023-08-13 17:00:46 +02:00
parent 600ef9d445
commit 9b4aa6e370
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI
2 changed files with 19 additions and 10 deletions

18
flag.go Normal file

@ -0,0 +1,18 @@
// Copyright 2023 wanderer <a_mirre at utb dot cz>
// SPDX-License-Identifier: AGPL-3.0-only
package main
import "flag"
var (
hostFlag = flag.String("host", "unset", "host address 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")
configIsPathFlag = flag.Bool("configIsPath", true, "Whether the provided config is path or raw config")
develFlag = flag.Bool("devel", false, "Run the application in dev mode, connect to a local browser-sync instance for hot-reloading")
licenseFlag = flag.Bool("license", false, "Print licensing information and exit")
versionFlag = flag.Bool("version", false, "Print version and exit")
importFlag = flag.String("import", "", "Path to import breach data from")
printMigrationFlag = flag.Bool("printMigration", false, "Print to stdout what is about to happen during the following database migration (mainly useful for debugging")
)

11
run.go

@ -60,16 +60,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.`
)
var (
hostFlag = flag.String("host", "unset", "host address 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")
configIsPathFlag = flag.Bool("configIsPath", true, "Whether the provided config is path or raw config")
develFlag = flag.Bool("devel", false, "Run the application in dev mode, connect to a local browser-sync instance for hot-reloading")
licenseFlag = flag.Bool("license", false, "Print licensing information and exit")
versionFlag = flag.Bool("version", false, "Print version and exit")
importFlag = flag.String("import", "", "Path to import breach data from")
printMigrationFlag = flag.Bool("printMigration", false, "Print to stdout what is about to happen during the following database migration (mainly useful for debugging")
version = "dev"
version = "dev"
// the global logger.
slogger *slogging.Slogger
// local logger instance.