Menu

#580 "--pad-include" takes effect only being the last option

closed-fixed
None
2024-09-08
2024-09-04
Anbang LI
No

Option "--pad-include" is to insert space padding after include directives.
I found it takes effect only being the last option.

For example code in file "test.cpp":

#include<stdio.h>
#include<math.h>

If I run command:
astyle -A2 --pad-include --pad-oper test.cpp
No change occurs in the code.

If I move option "--pad-include" to be the last option, run command:
astyle -A2 --pad-oper --pad-include test.cpp
then the code becomes:

#include <stdio.h>
#include <math.h>

Besides, if the source file is saved in "UTF-8 BOM" coding (the first 3 bytes of the file is for "Byte Order Mark"), and the first line is "#include<stdio.h>", then "--pad-include" takes no effect on the first line. </stdio.h>

Discussion

  • André Simon

    André Simon - 2024-09-04
    • status: open --> open-accepted
    • assigned_to: André Simon
     
  • André Simon

    André Simon - 2024-09-04

    So I reinvented positional arguments.... fixed in git repo.

     
  • André Simon

    André Simon - 2024-09-08
    • status: open-accepted --> closed-fixed
     
  • André Simon

    André Simon - 2024-09-08

    Fixed in 3.6.1

     

Log in to post a comment.

MongoDB Logo MongoDB