Matyas
Matyas

Reputation: 654

How to specify suboptions for clang-format?

In the .clang-format file I can say:

BasedOnStyle: LLVM
BreakBeforeBraces: Custom
BraceWrapping:
    AfterClass: false
    AfterFunction: true 

How do I specify the same on the command line? (For some reason using .clang-format is not an option.)

I tried:

--style="{BasedOnStyle: LLVM, BreakBeforeBraces: Custom, BraceWrapping:, AfterClass: false, AfterFunction: true}"

and

--style="{BasedOnStyle: LLVM, BreakBeforeBraces: Custom, BraceWrapping: AfterClass: false, BraceWrapping: AfterFunction: true}"

as well as some other variations using BraceWrapping.Afterclass, BraceWrapping:AfterClass, BraceWrappingAfterClass, etc.

I also tried:

--style="{BreakBeforeBraces: Custom, BraceWrapping: [{AfterClass: false}, {AfterFunction: true}]}"

which attempt was based on: Running clang-format with command line: specify IncludeCategories

and some further variants of this. No luck so far...

Upvotes: 2

Views: 218

Answers (1)

Matyas
Matyas

Reputation: 654

Further tries lead to:

--style="{BasedOnStyle: LLVM, BreakBeforeBraces: Custom, BraceWrapping: {AfterClass: false, AfterFunction: true}}"

Upvotes: 1

Related Questions