From 986d2064a7e222206c7a838f78e7c36fb72918aa Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Sat, 21 Aug 2021 14:15:55 -0700 Subject: [PATCH] Change recoverable errors to warn log level to stop shell from exiting --- cmd/itctl/cmd/time.go | 5 +++-- cmd/itctl/cmd/upgrade.go | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/itctl/cmd/time.go b/cmd/itctl/cmd/time.go index 86afe3f..95ec285 100644 --- a/cmd/itctl/cmd/time.go +++ b/cmd/itctl/cmd/time.go @@ -36,9 +36,10 @@ var timeCmd = &cobra.Command{ // Ensure required arguments if len(args) != 1 { cmd.Usage() - log.Fatal().Msg("Command time requires one argument") + log.Warn().Msg("Command time requires one argument") + return } - + // Connect to itd UNIX socket conn, err := net.Dial("unix", SockPath) if err != nil { diff --git a/cmd/itctl/cmd/upgrade.go b/cmd/itctl/cmd/upgrade.go index a87283d..dfdf173 100644 --- a/cmd/itctl/cmd/upgrade.go +++ b/cmd/itctl/cmd/upgrade.go @@ -60,7 +60,8 @@ var upgradeCmd = &cobra.Command{ } } else { cmd.Usage() - log.Fatal().Msg("Upgrade command requires either archive or init packet and firmware.") + log.Warn().Msg("Upgrade command requires either archive or init packet and firmware.") + return } // Encode response into connection