#!/usr/bin/env bash

# Copyright (c) 2011-2021. The SimGrid Team.
# All rights reserved.

# This program is free software; you can redistribute it and/or modify it
# under the terms of the license (GNU LGPL) which comes with this package.

declare -a OPTIONS
OPTIONS=(
    -kr         # Use Kernighan & Ritchie coding style.
    -l120       # Set maximum line length for non-comment lines to 120.
    -nut        # Use spaces instead of tabs.
    -i2         # Set indentation level to 2 spaces.
    -lps        # Leave space between ‘#’ and preprocessor directive.
    -npcs       # Do not put space after the function in function calls.
    -br         # Put braces on line with if, etc.
    -brs        # Put braces on struct declaration line.
    -ce         # Cuddle else and preceding ‘}’.
    -cdw        # Cuddle while of do {} while; and preceding ‘}’.
    -bbo        # Prefer to break long lines before boolean operators.
    -npsl       # Put the type of a procedure on the same line as its name.
)

exec indent "${OPTIONS[@]}" "$@"
