I did some digging around.
Source file:
void main()
{
if(def ==1) def=3;
else def=12;
while(def<12) def--;
}
int Foo(bool isBar)
{
if (isBar)
{
bar();
return 1;
}
else
return 0;
}
switch (foo)
{
case 1:
a += 1;
break;
case 2:
{
a += 2;
break;
}
}
command with aStyle 3.1 command used: astyle -A1 --indent=spaces=2 -f -j < benchmark.cpp > test.cpp
results in:
void main()
{
if(def ==1)
{
def=3;
}
else
{
def=12;
}
while(def<12)
{
def--;
}
}
int Foo(bool isBar)
{
if (isBar)
{
bar();
return 1;
}
else
{
return 0;
}
}
switch (foo)
{
case 1:
a += 1;
break;
case 2:
{
a += 2;
break;
}
}
I see "--add-one-line-braces / -J" in the option window of C::B but apparently I am overlooking the "--add-braces / -j" that I need.
Any suggestions which option to enable on the screen?