From 5d0547246eb91dc9cdf2bae67b39c9f67c286330 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sun, 17 Sep 2023 21:07:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E6=98=AF=E5=8A=A0=E4=B8=8A=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E9=A2=9D=E5=A4=96=E7=9A=84=E5=88=A4=E6=96=AD=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/utils/nuitka.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/utils/nuitka.py b/libs/utils/nuitka.py index 9f3eed2..e1e3dda 100644 --- a/libs/utils/nuitka.py +++ b/libs/utils/nuitka.py @@ -25,13 +25,18 @@ def ensure_cmd_readable(cmd: str) -> str: return cmd -def format_cmd(arg_name: Optional[str] = None, arg_value: Optional[Union[str, List[str]]] = None) -> List[str]: +def format_cmd(arg_name: Optional[str] = None, + arg_value: Optional[Union[str, List[str]]] = None, + write: Optional[bool] = True) -> List[str]: """ 用来格式化输出命令行参数 :param arg_name: 类似 --show-memory 之类的主项 :param arg_value: 类似 xxx 类的内容 + :param write: 是否写入 :return: 直接拼接好的命令行参数 不带 = """ + if not write: + return [] if arg_name is None: return [] if arg_value is None: