MCPcopy Index your code
hub / github.com/foxcpp/maddy / init

Function init

maddy.go:106–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104}
105
106func init() {
107 maddycli.AddGlobalFlag(
108 &cli.PathFlag{
109 Name: "config",
110 Usage: "Configuration file to use",
111 EnvVars: []string{"MADDY_CONFIG"},
112 Value: filepath.Join(ConfigDirectory, "maddy.conf"),
113 },
114 )
115 maddycli.AddGlobalFlag(&cli.BoolFlag{
116 Name: "debug",
117 Usage: "enable debug logging early",
118 Destination: &log.DefaultLogger.Debug,
119 })
120 maddycli.AddSubcommand(&cli.Command{
121 Name: "verify-config",
122 Usage: "Check configuration file for errors",
123 Flags: []cli.Flag{
124 &cli.BoolFlag{
125 Name: "debug",
126 Usage: "enable debug logging early",
127 Destination: &log.DefaultLogger.Debug,
128 },
129 },
130 Action: VerifyConfig,
131 })
132 maddycli.AddSubcommand(&cli.Command{
133 Name: "run",
134 Usage: "Start the server",
135 Flags: []cli.Flag{
136 &cli.StringFlag{
137 Name: "libexec",
138 Value: DefaultLibexecDirectory,
139 Usage: "path to the libexec directory",
140 Destination: &config.LibexecDirectory,
141 },
142 &cli.StringSliceFlag{
143 Name: "log",
144 Usage: "default logging target(s)",
145 Value: cli.NewStringSlice("stderr"),
146 },
147 &cli.BoolFlag{
148 Name: "v",
149 Usage: "print version and build metadata, then exit",
150 Hidden: true,
151 },
152 },
153 Action: Run,
154 })
155 maddycli.AddSubcommand(&cli.Command{
156 Name: "version",
157 Usage: "Print version and build metadata, then exit",
158 Action: func(c *cli.Context) error {
159 fmt.Println(BuildInfo())
160 return nil
161 },
162 })
163

Callers

nothing calls this directly

Calls 2

BuildInfoFunction · 0.85
PrintlnMethod · 0.80

Tested by

no test coverage detected