Skip to content

Commit 69fd020

Browse files
author
Your Name
committed
Add quiet parameter from PR #536
1 parent 83d78f1 commit 69fd020

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cecli/sessions.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def list_sessions(self) -> List[Dict]:
8888

8989
return sessions
9090

91-
async def load_session(self, session_identifier: str, switch=True) -> bool:
91+
async def load_session(self, session_identifier: str, switch=True, quiet: bool = False) -> bool:
9292
"""Load a saved session by name or file path."""
9393
if not session_identifier:
9494
self.io.tool_error("Please provide a session name or file path.")
@@ -103,12 +103,14 @@ async def load_session(self, session_identifier: str, switch=True) -> bool:
103103
with open(session_file, "r", encoding="utf-8") as f:
104104
session_data = json.load(f)
105105
except Exception as e:
106-
self.io.tool_error(f"Error loading session: {e}")
106+
if not quiet:
107+
self.io.tool_error(f"Error loading session: {e}")
107108
return False
108109

109110
# Verify session format
110111
if not isinstance(session_data, dict) or "version" not in session_data:
111-
self.io.tool_error("Invalid session format.")
112+
if not quiet:
113+
self.io.tool_error("Invalid session format.")
112114
return False
113115

114116
# Apply session data

0 commit comments

Comments
 (0)