I'm using the indent utility to reformat c source files and I notice that the options you provide to the utility affects the whole file. I'm wondering if its possible to only format certain sections of code instead of formatting all the code in the input file.
For example I have a source file called test.c with the following code
After running this command
This is the reformatted source file
There are multiple tabs after each of my variable declarations and I would like it to remain that way but after running this file through indent, I not only get the indents of 3 spaces that I ask for, but I also lose the tab spaces after the variable declarations. Is it possible to use indent the beginning of each line only?
Thank you in advance
For example I have a source file called test.c with the following code
Code:
struct _MYSTRUCT {
int i;
int j;
}MYSTRUCT;
void main()
{
struct MYSTRUCT ST;
}
After running this command
Code:
indent -i3 test.c
This is the reformatted source file
Code:
struct _MYSTRUCT {
int i;
int j;
}MYSTRUCT;
void main()
{
struct MYSTRUCT ST;
}
Thank you in advance