Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NBHF4R9EAejDJUMdwr6C68
25 lines
624 B
Go
25 lines
624 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"io"
|
|
)
|
|
|
|
const defaultConfigPath = "/etc/vpnportal/config.yaml"
|
|
|
|
func configFlags(name string, stderr io.Writer) (*flag.FlagSet, *string) {
|
|
fs := flag.NewFlagSet(name, flag.ContinueOnError)
|
|
fs.SetOutput(stderr)
|
|
path := fs.String("config", defaultConfigPath, "Pfad zur Konfigurationsdatei")
|
|
return fs, path
|
|
}
|
|
|
|
func runServe(args []string, stdout, stderr io.Writer) int {
|
|
fs, path := configFlags("serve", stderr)
|
|
if err := fs.Parse(args); err != nil {
|
|
return 2
|
|
}
|
|
fmt.Fprintf(stderr, "Fehler: config %q kann noch nicht geladen werden (nicht implementiert)\n", *path)
|
|
return 1
|
|
}
|