You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if '-h' in text:
P_text(PRINT_HELP)
elif '-t' in text:
i = text.index('-t')
res = func(text[i+1])
P_text()
print(f"return:{res}")
return res
elif '-f' in text:
i = text.index('-f')
files = OpenFiles(text[i+1])
res = func(files)
P_text()
print(f"return: {res}")
return res
else:
print(f'Invalid keyword: {text}, Maybe you can try "-h" to get help.')
那将会出现问题:
在同时使用-t和-f时,她将只会使用-t去完成,如:
python .\114514.py -f a.txt -t 'So just yolo.'
结果为:
return:sO jUst YOLo.
当另一个参数不正确时,她并不会报告出来,如:
python .\114514.py -t 'So just yolo.' --out-put a.txt
命令本意是要把结果输出到a.txt,但不幸的是他写错了(一共才几个参数都能写错,你要知耻啊)
结果为:
return:SO JuSt yOlo.
并没有报错来提示这个可怜的人,结果也没有输出到a.txt
The text was updated successfully, but these errors were encountered:
@dev
在
Target
中,-t
和-f
的判断如下:那将会出现问题:
-t
和-f
时,她将只会使用-t
去完成,如:结果为:
命令本意是要把结果输出到
a.txt
,但不幸的是他写错了(一共才几个参数都能写错,你要知耻啊)结果为:
并没有报错来提示这个可怜的人,结果也没有输出到
a.txt
The text was updated successfully, but these errors were encountered: