10 lines
352 B
Python
Raw Normal View History

2025-08-23 19:18:29 +08:00
def clean_command(command: str) -> str:
"""清理命令字符串"""
# 移除可能的引号和多余空格
command = command.strip()
if command.startswith('"') and command.endswith('"'):
command = command[1:-1]
if command.startswith("'") and command.endswith("'"):
command = command[1:-1]
return command.strip()