应该使用什么选项来使用 astyle 删除多余的空格?

Mey*_*sam 5 c++ formatting coding-style code-formatting astyle

如何使用 删除代码中的多余空格astyle?例如我想转换以下代码:

void foo (     int  a  ,  int   c )
{
d   = a+      c;
}
Run Code Online (Sandbox Code Playgroud)

对此:

void foo (int a, int c)
{
    d = a + c;
}
Run Code Online (Sandbox Code Playgroud)

但是 astyle 目前正在将其转换为:

void foo (int  a  ,  int   c)
{
    d   = a +      c;
}
Run Code Online (Sandbox Code Playgroud)

Jia*_*eng 2

--squeeze-ws 最终可以完成这项工作(astyle v3.3+)

https://astyle.sourceforge.net/astyle.html#_squeeze-ws