还是加上一个额外的判断参数吧
This commit is contained in:
parent
ce1fc24bff
commit
5d0547246e
@ -25,13 +25,18 @@ def ensure_cmd_readable(cmd: str) -> str:
|
|||||||
return cmd
|
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_name: 类似 --show-memory 之类的主项
|
||||||
:param arg_value: 类似 xxx 类的内容
|
:param arg_value: 类似 xxx 类的内容
|
||||||
|
:param write: 是否写入
|
||||||
:return: 直接拼接好的命令行参数 不带 =
|
:return: 直接拼接好的命令行参数 不带 =
|
||||||
"""
|
"""
|
||||||
|
if not write:
|
||||||
|
return []
|
||||||
if arg_name is None:
|
if arg_name is None:
|
||||||
return []
|
return []
|
||||||
if arg_value is None:
|
if arg_value is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user