app: handle launch method in New function

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
2024-09-12 20:53:33 +09:00
parent 8223a9ee66
commit b0aff89166
6 changed files with 125 additions and 52 deletions

View File

@@ -2,8 +2,6 @@ package main
import (
"flag"
"git.ophivana.moe/cat/fortify/internal/app"
)
var (
@@ -38,9 +36,6 @@ func init() {
flag.BoolVar(&mustDBus, "dbus", false, "Proxy D-Bus connection")
flag.BoolVar(&mustPulse, "pulse", false, "Share PulseAudio socket and cookie")
flag.BoolVar(&app.LaunchOptions[app.LaunchMethodSudo], "sudo", false, "Use 'sudo' to switch user")
flag.BoolVar(&app.LaunchOptions[app.LaunchMethodMachineCtl], "machinectl", true, "Use 'machinectl' to switch user")
flag.BoolVar(&flagVerbose, "v", false, "Verbose output")
flag.BoolVar(&printVersion, "V", false, "Print version")
}