2025-03-14 21:59:59 -06: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.
|
2025-12-16 10:20:31 -07:00
|
|
|
> More information: <https://manned.org/astyle>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Apply the default style of 4 spaces per indent and no formatting changes:
|
|
|
|
|
|
|
|
|
|
`astyle {{source_file}}`
|
|
|
|
|
|
|
|
|
|
- Apply the Java style with attached braces:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`astyle {{[-A2|--style=java]}} {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Apply the allman style with broken braces:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`astyle {{[-A1|--style=allman]}} {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Apply a custom indent using spaces. Choose between 2 and 20 spaces:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`astyle {{[-s|--indent=spaces=]}}{{number_of_spaces}} {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Apply a custom indent using tabs. Choose between 2 and 20 tabs:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`astyle {{[-t|--indent=tab=]}}{{number_of_tabs}} {{path/to/file}}`
|