我想对Windows CMD文件夹中的所有.cpp文件运行cpplint.py。
py .\cpplint.py *.cpp不知何故,这不起作用。我得到了错误:
Skipping input '*.cpp': Can't open for reading
Total errors found: 0我以为*是select all的运算符,我说错了吗?
附言:有一个类似的post,但它并没有真正的帮助。
发布于 2021-02-16 05:38:34
Windows的CMD不支持通配符扩展:https://superuser.com/questions/460598/is-there-any-way-to-get-the-windows-cmd-shell-to-expand-wildcard-paths
将*扩展到路径是由应用程序来处理的,这与Linux形成了鲜明对比,在Linux中,shell自己处理这一问题。因此,您将字符串文字*传递给cpplint.py,它不是一个文件。
发布于 2021-02-16 05:52:25
在批处理文件中或从命令行中,您可以执行以下操作:
for %%f in (*.cpp) do py .\cpplint.py %%fhttps://stackoverflow.com/questions/66215709
复制相似问题