flag: move method flag from main

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
2024-09-13 11:49:10 +09:00
parent da6d238d8a
commit 40d0550ad3
2 changed files with 11 additions and 10 deletions

11
flag.go
View File

@@ -2,6 +2,8 @@ package main
import (
"flag"
"git.ophivana.moe/cat/fortify/internal/util"
)
var (
@@ -39,3 +41,12 @@ func init() {
flag.BoolVar(&flagVerbose, "v", false, "Verbose output")
flag.BoolVar(&printVersion, "V", false, "Print version")
}
func init() {
methodHelpString := "Method of launching the child process, can be one of \"sudo\", \"bubblewrap\""
if util.SdBootedV {
methodHelpString += ", \"systemd\""
}
flag.StringVar(&launchOptionText, "method", "sudo", methodHelpString)
}