我的操作系统是ubuntu16.04,我想使用clang格式中包含的-运行选项。但当我在终端上写clang-format --help
时,它没有我猜是因为版本。在编写sudo apt-get install clang-format
时,我展示了如何安装clang 3.8。所以我想知道
发布于 2021-02-20 19:23:03
的原因,clang-格式没有-是因为版本?
是的,当Clang10.0.0出现时,--dry-run
被添加到in Nov 2019中。
如果第一个问题是肯定的,我是否可以在10以上安装clang格式的版本?
您可以将您的Ubuntu安装升级为clang格式10为available in newer systems,也可以手动构建它,但现在最容易也是最可取的方法是运行正式的Ubuntu docker image。
$ docker run -it ubuntu
root@502d5d8cfb26:/# head -n2 /etc/os-release
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
root@502d5d8cfb26:/# apt-get update
root@502d5d8cfb26:/# apt-get -y install clang-format
root@502d5d8cfb26:/# clang-format --version
clang-format version 10.0.0-4ubuntu1
root@502d5d8cfb26:/# clang-format --help | grep -- '--dry-run'
--dry-run - If set, do not actually make the formatting changes
--ferror-limit=<uint> - Set the maximum number of clang-format errors to emit before stopping (0 = no limit). Used only with --dry-run or -n
-n - Alias for --dry-run
https://stackoverflow.com/questions/66294474
复制相似问题