summaryrefslogtreecommitdiff
blob: 353dfa8d41087f350cd885a5bd1dc1c2be6bfb9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
--- astyle_main.cpp	2002-03-07 08:22:30.000000000 +0100
+++ /root/astyle_main.cpp.fixed	2004-02-25 22:05:13.841700600 +0100
@@ -267,22 +267,22 @@
     {
         manuallySetJavaStyle(formatter);
     }
-    else if ( IS_OPTIONS(arg, "t", "indent=tab=") )
-    {
-        int spaceNum = 4;
-        string spaceNumParam = GET_PARAMS(arg, "t", "indent=tab=");
-        if (spaceNumParam.length() > 0)
-            spaceNum = atoi(spaceNumParam.c_str());
-        formatter.setTabIndentation(spaceNum, false);
-    }
-    else if ( IS_OPTIONS(arg, "T", "force-indent=tab=") )
-    {
-        int spaceNum = 4;
-        string spaceNumParam = GET_PARAMS(arg, "T", "force-indent=tab=");
-        if (spaceNumParam.length() > 0)
-            spaceNum = atoi(spaceNumParam.c_str());
-        formatter.setTabIndentation(spaceNum, true);
-    }
+    else if ( IS_PARAM_OPTIONS(arg, "t", "indent=tab=") )
+    {
+        int spaceNum = 4;
+        string spaceNumParam = GET_PARAMS(arg, "t", "indent=tab=");
+        if (spaceNumParam.length() > 0)
+            spaceNum = atoi(spaceNumParam.c_str());
+        formatter.setTabIndentation(spaceNum, false);
+    }
+    else if ( IS_PARAM_OPTIONS(arg, "T", "force-indent=tab=") )
+    {
+        int spaceNum = 4;
+        string spaceNumParam = GET_PARAMS(arg, "T", "force-indent=tab=");
+        if (spaceNumParam.length() > 0)
+            spaceNum = atoi(spaceNumParam.c_str());
+        formatter.setTabIndentation(spaceNum, true);
+    }
     else if ( IS_PARAM_OPTION(arg, "indent=tab") )
     {
         formatter.setTabIndentation(4);
@@ -343,10 +343,10 @@
     {
         formatter.setLabelIndent(true);
     }
-    else if ( IS_OPTION(arg, "brackets=break-closing-headers") )
-    {
-        formatter.setBreakClosingHeaderBracketsMode(true);
-    }
+    else if ( IS_OPTION(arg, "brackets=break-closing-headers") )
+    {
+        formatter.setBreakClosingHeaderBracketsMode(true);
+    }
     else if ( IS_OPTIONS(arg, "b", "brackets=break") )
     {
         formatter.setBracketFormatMode(BREAK_MODE);
@@ -400,10 +400,10 @@
     else if (IS_OPTION(arg, "break-blocks"))
     {
         formatter.setBreakBlocksMode(true);
-    }
-    else if (IS_OPTION(arg, "break-elseifs"))
-    {
-        formatter.setBreakElseIfsMode(true);
+    }
+    else if (IS_OPTION(arg, "break-elseifs"))
+    {
+        formatter.setBreakElseIfsMode(true);
     }
     else if ( IS_OPTIONS(arg, "X", "errors-to-standard-output") )
     {
@@ -528,20 +528,20 @@
     (*_err) << "    -j   OR   --mode=java\n";
     (*_err) << "    Indent a Java(TM) source file\n";
     (*_err) << endl;
-    (*_err) << "    -s   OR   -s#   OR   --indent=spaces=#\n";
-    (*_err) << "    Indent using # spaces per indent. Not specifying #\n" ;
-    (*_err) << "    will result in a default of 4 spacec per indent.\n" ;
-    (*_err) << endl;
+    (*_err) << "    -s   OR   -s#   OR   --indent=spaces=#\n";
+    (*_err) << "    Indent using # spaces per indent. Not specifying #\n" ;
+    (*_err) << "    will result in a default of 4 spacec per indent.\n" ;
+    (*_err) << endl;
     (*_err) << "    -t   OR   -t#   OR   --indent=tab=#\n";
     (*_err) << "    Indent using tab characters, assuming that each\n";
     (*_err) << "    tab is # spaces long. Not specifying # will result\n";
     (*_err) << "    in a default assumption of 4 spaces per tab.\n" ;
-    (*_err) << endl;
-    (*_err) << "    -T#   OR   --force-indent=tab=#";
-    (*_err) << "    Indent using tab characters, assuming that each\n";
-    (*_err) << "    tab is # spaces long. Force tabs to be used in areas\n";
-    (*_err) << "    Astyle would prefer to use spaces.\n" ;
-    (*_err) << endl;
+    (*_err) << endl;
+    (*_err) << "    -T#   OR   --force-indent=tab=#";
+    (*_err) << "    Indent using tab characters, assuming that each\n";
+    (*_err) << "    tab is # spaces long. Force tabs to be used in areas\n";
+    (*_err) << "    Astyle would prefer to use spaces.\n" ;
+    (*_err) << endl;
     (*_err) << "    -C   OR   --indent-classes\n";
     (*_err) << "    Indent 'class' blocks, so that the inner 'public:',\n";
     (*_err) << "    'protected:' and 'private: headers are indented in\n";
@@ -596,10 +596,10 @@
     (*_err) << "    Break definition-block brackets and attach command-block\n";
     (*_err) << "    brackets.\n";
     (*_err) << endl;
-    (*_err) << "    --brackets=break-closing-headers\n";
-    (*_err) << "    Break brackets before closing headers (e.g. 'else', 'catch', ..).\n";
-    (*_err) << "    Should be appended to --brackets=attach or --brackets=linux.\n";
-    (*_err) << endl;
+    (*_err) << "    --brackets=break-closing-headers\n";
+    (*_err) << "    Break brackets before closing headers (e.g. 'else', 'catch', ..).\n";
+    (*_err) << "    Should be appended to --brackets=attach or --brackets=linux.\n";
+    (*_err) << endl;
     (*_err) << "    -o   OR  --one-line=keep-statements\n";
     (*_err) << "    Don't break lines containing multiple statements into\n";
     (*_err) << "    multiple single-statement lines.\n";
@@ -626,9 +626,9 @@
     (*_err) << "    Like --break-blocks, except also insert empty lines \n";
     (*_err) << "    around closing headers (e.g. 'else', 'catch', ...).\n";
     (*_err) << endl;
-    (*_err) << "    --break-elseifs\n";
-    (*_err) << "    Break 'else if()' statements into two different lines.\n";
-    (*_err) << endl;
+    (*_err) << "    --break-elseifs\n";
+    (*_err) << "    Break 'else if()' statements into two different lines.\n";
+    (*_err) << endl;
     (*_err) << "Other options:\n";
     (*_err) << "-------------\n";
     (*_err) << "    --suffix=####\n";
@@ -762,7 +762,7 @@
 
     if (shouldPrintHelp)
     {
-        printHelp();
+        printHelp();
 		exit(1);
     }