package launch

type Mode string

const (
	ModeGUI              Mode = "gui"
	ModeInstallService   Mode = "install-service"
	ModeUninstallService Mode = "uninstall-service"
	ModePrepareUpgrade   Mode = "prepare-upgrade"
	ModeFirewall         Mode = "firewall"
	ModeSubprocess       Mode = "subprocess"
	ModeService          Mode = "service"
)

type Args struct {
	Install        bool
	Uninstall      bool
	PrepareUpgrade bool
	Firewall       bool
	Subprocess     bool
}

func ResolveMode(args Args, isService bool) Mode {
	switch {
	case args.Install:
		return ModeInstallService
	case args.Uninstall:
		return ModeUninstallService
	case args.PrepareUpgrade:
		return ModePrepareUpgrade
	case args.Firewall:
		return ModeFirewall
	case args.Subprocess:
		return ModeSubprocess
	case isService:
		return ModeService
	default:
		return ModeGUI
	}
}
