Add persistent startup console warning

This commit is contained in:
Mikhail Chusavitin
2026-02-20 14:37:21 +03:00
parent c295b60dd8
commit 3fd7a2231a

View File

@@ -46,8 +46,11 @@ var Version = "dev"
const backgroundSyncInterval = 5 * time.Minute const backgroundSyncInterval = 5 * time.Minute
const onDemandPullCooldown = 30 * time.Second const onDemandPullCooldown = 30 * time.Second
const startupConsoleWarning = "Не закрывайте консоль иначе приложение не будет работать"
func main() { func main() {
showStartupConsoleWarning()
configPath := flag.String("config", "", "path to config file (default: user state dir or QFS_CONFIG_PATH)") configPath := flag.String("config", "", "path to config file (default: user state dir or QFS_CONFIG_PATH)")
localDBPath := flag.String("localdb", "", "path to local SQLite database (default: user state dir or QFS_DB_PATH)") localDBPath := flag.String("localdb", "", "path to local SQLite database (default: user state dir or QFS_DB_PATH)")
resetLocalDB := flag.Bool("reset-localdb", false, "reset local SQLite data on startup (keeps connection settings)") resetLocalDB := flag.Bool("reset-localdb", false, "reset local SQLite data on startup (keeps connection settings)")
@@ -303,6 +306,13 @@ func main() {
} }
} }
func showStartupConsoleWarning() {
// Visible in console output.
fmt.Println(startupConsoleWarning)
// Keep the warning always visible in the console window title when supported.
fmt.Printf("\033]0;%s\007", startupConsoleWarning)
}
func shouldResetLocalDB(flagValue bool) bool { func shouldResetLocalDB(flagValue bool) bool {
if flagValue { if flagValue {
return true return true