Menu

#517 --delete-empty-lines is wrongly documented

open-accepted
None
2023-02-14
2019-01-04
Daniel
No

According to http://astyle.sourceforge.net/astyle.html#_delete-empty-lines , "Empty lines outside of functions or methods are NOT deleted."

However when I run the command astyle --delete-empty-lines file_name.c

file_name.c

:::c
int main()
{

    int Foo(bool isBar)
    {
        if (isBar, h)
        {
            bar();
            return 1;
        }
        else
            return 0;
    }

    int Foo(bool isBar)
    {
        if (isBar, h)
        {
            bar();
            return 1;
        }
        else
            return 0;
    }

    return 0;

}

becomes:

:::c
int main()
{
    int Foo(bool isBar)
    {
        if (isBar, h)
        {
            bar();
            return 1;
        }
        else
            return 0;
    }
    int Foo(bool isBar)
    {
        if (isBar, h)
        {
            bar();
            return 1;
        }
        else
            return 0;
    }
    return 0;
}

I am using astyle 3.1 on mac os.

Discussion

  • André Simon

    André Simon - 2023-02-14
    • status: open --> open-accepted
    • assigned_to: André Simon
     
  • André Simon

    André Simon - 2023-02-14

    The docs refer to functions in the top level of a file - not nested functions. I will check it in the code or fix the manual.

     

Log in to post a comment.

MongoDB Logo MongoDB