2017-11-13 05:38:17 +00:00
|
|
|
# astyle
|
|
|
|
|
|
|
|
> Source code indenter, formatter, and beautifier for the C, C++, C# and Java programming languages.
|
|
|
|
> Upon running, a copy of the original file is created with an ".orig" appended to the original file name.
|
2019-06-03 01:06:36 +01:00
|
|
|
> More information: <http://astyle.sourceforge.net/>.
|
2017-11-13 05:38:17 +00:00
|
|
|
|
|
|
|
- Apply the default style of 4 spaces per indent and no formatting changes:
|
|
|
|
|
|
|
|
`astyle {{source_file}}`
|
|
|
|
|
2021-07-13 09:59:48 +01:00
|
|
|
- Apply the Java style with attached braces:
|
2017-11-13 05:38:17 +00:00
|
|
|
|
|
|
|
`astyle --style=java {{path/to/file}}`
|
|
|
|
|
|
|
|
- Apply the allman style with broken braces:
|
|
|
|
|
|
|
|
`astyle --style=allman {{path/to/file}}`
|
|
|
|
|
|
|
|
- Apply a custom indent using spaces. Choose between 2 and 20 spaces:
|
|
|
|
|
|
|
|
`astyle --indent=spaces={{number_of_spaces}} {{path/to/file}}`
|
|
|
|
|
|
|
|
- Apply a custom indent using tabs. Choose between 2 and 20 tabs:
|
|
|
|
|
|
|
|
`astyle --indent=tab={{number_of_tabs}} {{path/to/file}}`
|