|
|
{ | { |
manuallySetJavaStyle(formatter); | manuallySetJavaStyle(formatter); |
} | } |
else if ( IS_OPTIONS(arg, "t", "indent=tab=") ) |
else if ( IS_PARAM_OPTIONS(arg, "t", "indent=tab=") ) |
{ |
{ |
int spaceNum = 4; |
int spaceNum = 4; |
string spaceNumParam = GET_PARAMS(arg, "t", "indent=tab="); |
string spaceNumParam = GET_PARAMS(arg, "t", "indent=tab="); |
if (spaceNumParam.length() > 0) |
if (spaceNumParam.length() > 0) |
spaceNum = atoi(spaceNumParam.c_str()); |
spaceNum = atoi(spaceNumParam.c_str()); |
formatter.setTabIndentation(spaceNum, false); |
formatter.setTabIndentation(spaceNum, false); |
} |
} |
else if ( IS_OPTIONS(arg, "T", "force-indent=tab=") ) |
else if ( IS_PARAM_OPTIONS(arg, "T", "force-indent=tab=") ) |
{ |
{ |
int spaceNum = 4; |
int spaceNum = 4; |
string spaceNumParam = GET_PARAMS(arg, "T", "force-indent=tab="); |
string spaceNumParam = GET_PARAMS(arg, "T", "force-indent=tab="); |
if (spaceNumParam.length() > 0) |
if (spaceNumParam.length() > 0) |
spaceNum = atoi(spaceNumParam.c_str()); |
spaceNum = atoi(spaceNumParam.c_str()); |
formatter.setTabIndentation(spaceNum, true); |
formatter.setTabIndentation(spaceNum, true); |
} |
} |
else if ( IS_PARAM_OPTION(arg, "indent=tab") ) | else if ( IS_PARAM_OPTION(arg, "indent=tab") ) |
{ | { |
formatter.setTabIndentation(4); | formatter.setTabIndentation(4); |
|
|
{ | { |
formatter.setLabelIndent(true); | formatter.setLabelIndent(true); |
} | } |
else if ( IS_OPTION(arg, "brackets=break-closing-headers") ) |
else if ( IS_OPTION(arg, "brackets=break-closing-headers") ) |
{ |
{ |
formatter.setBreakClosingHeaderBracketsMode(true); |
formatter.setBreakClosingHeaderBracketsMode(true); |
} |
} |
else if ( IS_OPTIONS(arg, "b", "brackets=break") ) | else if ( IS_OPTIONS(arg, "b", "brackets=break") ) |
{ | { |
formatter.setBracketFormatMode(BREAK_MODE); | formatter.setBracketFormatMode(BREAK_MODE); |
|
|
else if (IS_OPTION(arg, "break-blocks")) | else if (IS_OPTION(arg, "break-blocks")) |
{ | { |
formatter.setBreakBlocksMode(true); | formatter.setBreakBlocksMode(true); |
} |
} |
else if (IS_OPTION(arg, "break-elseifs")) |
else if (IS_OPTION(arg, "break-elseifs")) |
{ |
{ |
formatter.setBreakElseIfsMode(true); |
formatter.setBreakElseIfsMode(true); |
} | } |
else if ( IS_OPTIONS(arg, "X", "errors-to-standard-output") ) | else if ( IS_OPTIONS(arg, "X", "errors-to-standard-output") ) |
{ | { |
|
|
(*_err) << " -j OR --mode=java\n"; | (*_err) << " -j OR --mode=java\n"; |
(*_err) << " Indent a Java(TM) source file\n"; | (*_err) << " Indent a Java(TM) source file\n"; |
(*_err) << endl; | (*_err) << endl; |
(*_err) << " -s OR -s# OR --indent=spaces=#\n"; |
(*_err) << " -s OR -s# OR --indent=spaces=#\n"; |
(*_err) << " Indent using # spaces per indent. Not specifying #\n" ; |
(*_err) << " Indent using # spaces per indent. Not specifying #\n" ; |
(*_err) << " will result in a default of 4 spacec per indent.\n" ; |
(*_err) << " will result in a default of 4 spacec per indent.\n" ; |
(*_err) << endl; |
(*_err) << endl; |
(*_err) << " -t OR -t# OR --indent=tab=#\n"; | (*_err) << " -t OR -t# OR --indent=tab=#\n"; |
(*_err) << " Indent using tab characters, assuming that each\n"; | (*_err) << " Indent using tab characters, assuming that each\n"; |
(*_err) << " tab is # spaces long. Not specifying # will result\n"; | (*_err) << " tab is # spaces long. Not specifying # will result\n"; |
(*_err) << " in a default assumption of 4 spaces per tab.\n" ; | (*_err) << " in a default assumption of 4 spaces per tab.\n" ; |
(*_err) << endl; |
(*_err) << endl; |
(*_err) << " -T# OR --force-indent=tab=#"; |
(*_err) << " -T# OR --force-indent=tab=#"; |
(*_err) << " Indent using tab characters, assuming that each\n"; |
(*_err) << " Indent using tab characters, assuming that each\n"; |
(*_err) << " tab is # spaces long. Force tabs to be used in areas\n"; |
(*_err) << " tab is # spaces long. Force tabs to be used in areas\n"; |
(*_err) << " Astyle would prefer to use spaces.\n" ; |
(*_err) << " Astyle would prefer to use spaces.\n" ; |
(*_err) << endl; |
(*_err) << endl; |
(*_err) << " -C OR --indent-classes\n"; | (*_err) << " -C OR --indent-classes\n"; |
(*_err) << " Indent 'class' blocks, so that the inner 'public:',\n"; | (*_err) << " Indent 'class' blocks, so that the inner 'public:',\n"; |
(*_err) << " 'protected:' and 'private: headers are indented in\n"; | (*_err) << " 'protected:' and 'private: headers are indented in\n"; |
|
|
(*_err) << " Break definition-block brackets and attach command-block\n"; | (*_err) << " Break definition-block brackets and attach command-block\n"; |
(*_err) << " brackets.\n"; | (*_err) << " brackets.\n"; |
(*_err) << endl; | (*_err) << endl; |
(*_err) << " --brackets=break-closing-headers\n"; |
(*_err) << " --brackets=break-closing-headers\n"; |
(*_err) << " Break brackets before closing headers (e.g. 'else', 'catch', ..).\n"; |
(*_err) << " Break brackets before closing headers (e.g. 'else', 'catch', ..).\n"; |
(*_err) << " Should be appended to --brackets=attach or --brackets=linux.\n"; |
(*_err) << " Should be appended to --brackets=attach or --brackets=linux.\n"; |
(*_err) << endl; |
(*_err) << endl; |
(*_err) << " -o OR --one-line=keep-statements\n"; | (*_err) << " -o OR --one-line=keep-statements\n"; |
(*_err) << " Don't break lines containing multiple statements into\n"; | (*_err) << " Don't break lines containing multiple statements into\n"; |
(*_err) << " multiple single-statement lines.\n"; | (*_err) << " multiple single-statement lines.\n"; |
|
|
(*_err) << " Like --break-blocks, except also insert empty lines \n"; | (*_err) << " Like --break-blocks, except also insert empty lines \n"; |
(*_err) << " around closing headers (e.g. 'else', 'catch', ...).\n"; | (*_err) << " around closing headers (e.g. 'else', 'catch', ...).\n"; |
(*_err) << endl; | (*_err) << endl; |
(*_err) << " --break-elseifs\n"; |
(*_err) << " --break-elseifs\n"; |
(*_err) << " Break 'else if()' statements into two different lines.\n"; |
(*_err) << " Break 'else if()' statements into two different lines.\n"; |
(*_err) << endl; |
(*_err) << endl; |
(*_err) << "Other options:\n"; | (*_err) << "Other options:\n"; |
(*_err) << "-------------\n"; | (*_err) << "-------------\n"; |
(*_err) << " --suffix=####\n"; | (*_err) << " --suffix=####\n"; |
|
|
| |
if (shouldPrintHelp) | if (shouldPrintHelp) |
{ | { |
printHelp(); |
printHelp(); |
exit(1); | exit(1); |
} | } |
| |