forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit76fd342
committed
Provide a better error message for misplaced dispatch options.
Before this patch, misplacing a special must-be-first option fordispatching to a subprogram (e.g., postgres -D . --single) wouldfail with an error likeFATAL: --single requires a valueThis patch adjusts this error to more accurately complain that thespecial option wasn't listed first. The aforementioned errormessage now looks likeFATAL: --single must be first argumentThe dispatch option parsing code has been refactored for usewherever ParseLongOption() is called. Beyond the obvious advantageof avoiding code duplication, this should prevent similar problemswhen new dispatch options are added. Note that we assume that noneof the dispatch option names match another valid command-lineargument, such as the name of a configuration parameter.Ideally, we'd remove this must-be-first requirement for theseoptions, but after some investigation, we decided that wasn't worththe added complexity and behavior changes.Author: Nathan Bossart, Greg Sabino MullaneReviewed-by: Greg Sabino Mullane, Peter Eisentraut, Álvaro Herrera, Tom LaneDiscussion:https://postgr.es/m/CAKAnmmJkZtZAiSryho%3DgYpbvC7H-HNjEDAh16F3SoC9LPu8rqQ%40mail.gmail.com1 parent24c1c63 commit76fd342
File tree
6 files changed
+133
-16
lines changed- src
- backend
- bootstrap
- main
- postmaster
- tcop
- include/postmaster
- tools/pgindent
6 files changed
+133
-16
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
224 | 224 |
| |
225 | 225 |
| |
226 | 226 |
| |
227 |
| - | |
228 | 227 |
| |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
229 | 242 |
| |
230 | 243 |
| |
231 | 244 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
46 | 59 |
| |
47 | 60 |
| |
48 | 61 |
| |
| |||
57 | 70 |
| |
58 | 71 |
| |
59 | 72 |
| |
| 73 | + | |
60 | 74 |
| |
61 | 75 |
| |
62 | 76 |
| |
| |||
179 | 193 |
| |
180 | 194 |
| |
181 | 195 |
| |
182 |
| - | |
183 |
| - | |
184 |
| - | |
185 |
| - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
186 | 208 |
| |
187 |
| - | |
188 |
| - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
189 | 212 |
| |
190 |
| - | |
191 |
| - | |
192 |
| - | |
193 |
| - | |
194 |
| - | |
195 |
| - | |
196 |
| - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
197 | 226 |
| |
198 | 227 |
| |
199 | 228 |
| |
200 | 229 |
| |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
201 | 258 |
| |
| 259 | + | |
| 260 | + | |
| 261 | + | |
202 | 262 |
| |
203 | 263 |
| |
204 | 264 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
589 | 589 |
| |
590 | 590 |
| |
591 | 591 |
| |
592 |
| - | |
593 | 592 |
| |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
594 | 607 |
| |
595 | 608 |
| |
596 | 609 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3947 | 3947 |
| |
3948 | 3948 |
| |
3949 | 3949 |
| |
3950 |
| - | |
3951 | 3950 |
| |
| 3951 | + | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
| 3960 | + | |
| 3961 | + | |
| 3962 | + | |
| 3963 | + | |
| 3964 | + | |
3952 | 3965 |
| |
3953 | 3966 |
| |
3954 | 3967 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
138 | 138 |
| |
139 | 139 |
| |
140 | 140 |
| |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
141 | 158 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
619 | 619 |
| |
620 | 620 |
| |
621 | 621 |
| |
| 622 | + | |
622 | 623 |
| |
623 | 624 |
| |
624 | 625 |
| |
|
0 commit comments
Comments
(0)