Forrest logo
tool overview
On this page you find all important commands for the CLI tool astyle. If the command you are looking for is missing please ask our AI.

astyle

Astyle is a command line tool used for formatting and beautifying source code written in various programming languages. It can be used to automatically reformat code according to predefined style guidelines, making it more readable and consistent.

Some key features of astyle include:

  1. Support for a wide range of programming languages, including C, C++, C#, Java, Objective-C, and more.
  2. Configurable options for indentation style, line wrapping, braces placement, and various other formatting rules.
  3. Ability to handle complex code structures and nested statements, ensuring the formatting is correctly applied.
  4. Command line interface allows for easy integration into development workflows and build systems.
  5. Can be used as a standalone tool or incorporated into IDEs or text editors as a code formatting plugin.
  6. Supports batch processing of multiple files or entire directories at once.
  7. Provides options to preserve or modify comments within the code.

Using astyle can help maintain consistency across different code bases, making it easier for developers to read and understand each other's code. It can also be useful when collaborating on projects or when contributing code to open-source projects that follow specific coding style guidelines.

List of commands for astyle:

  • astyle:tldr:033ad astyle: Apply the allman style with broken braces.
    $ astyle --style=allman ${filename}
    try on your machine
    explain this command
  • astyle:tldr:0dea8 astyle: Apply a custom indent using spaces. Choose between 2 and 20 spaces.
    $ astyle --indent=spaces=${number_of_spaces} ${filename}
    try on your machine
    explain this command
  • astyle:tldr:3c85c astyle: Apply the default style of 4 spaces per indent and no formatting changes.
    $ astyle ${source_file}
    try on your machine
    explain this command
  • astyle:tldr:93394 astyle: Apply the Java style with attached braces.
    $ astyle --style=java ${filename}
    try on your machine
    explain this command
  • astyle:tldr:9fa0c astyle: Apply a custom indent using tabs. Choose between 2 and 20 tabs.
    $ astyle --indent=tab=${number_of_tabs} ${filename}
    try on your machine
    explain this command
tool overview