forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcccdbc5
committed
Clean up command argument assembly
Several commands internally assemble command lines to call othercommands. This includes initdb, pg_dumpall, and pg_regress. (Alsopg_ctl, but that is different enough that I didn't consider it here.)This has all evolved a bit organically, with fixed-size buffers, andvarious optional command-line arguments being injected withconfusing-looking code, and the spacing between options handled ininconsistent ways. Clean all this up a bit to look clearer and bemore easily extensible with new arguments and options. We start eachcommand with printfPQExpBuffer(), and then append arguments asnecessary with appendPQExpBuffer(). Also standardize on usinginitPQExpBuffer() over createPQExpBuffer() where possible. pg_regressuses StringInfo instead of PQExpBuffer, but many of the same ideasapply.Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>Discussion:https://www.postgresql.org/message-id/flat/16d0beac-a141-e5d3-60e9-323da75f49bf@eisentraut.org1 parentfa88928 commitcccdbc5
File tree
3 files changed
+62
-47
lines changed- src
- bin
- initdb
- pg_dump
- test/regress
3 files changed
+62
-47
lines changedLines changed: 31 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
309 | 309 |
| |
310 | 310 |
| |
311 | 311 |
| |
312 |
| - | |
| 312 | + | |
313 | 313 |
| |
314 |
| - | |
| 314 | + | |
315 | 315 |
| |
316 | 316 |
| |
317 | 317 |
| |
318 | 318 |
| |
319 | 319 |
| |
320 | 320 |
| |
321 |
| - | |
| 321 | + | |
322 | 322 |
| |
323 | 323 |
| |
324 | 324 |
| |
| |||
1138 | 1138 |
| |
1139 | 1139 |
| |
1140 | 1140 |
| |
1141 |
| - | |
| 1141 | + | |
1142 | 1142 |
| |
1143 | 1143 |
| |
1144 | 1144 |
| |
1145 | 1145 |
| |
| 1146 | + | |
| 1147 | + | |
1146 | 1148 |
| |
1147 |
| - | |
| 1149 | + | |
1148 | 1150 |
| |
1149 | 1151 |
| |
1150 | 1152 |
| |
| |||
1158 | 1160 |
| |
1159 | 1161 |
| |
1160 | 1162 |
| |
1161 |
| - | |
1162 |
| - | |
| 1163 | + | |
| 1164 | + | |
1163 | 1165 |
| |
1164 | 1166 |
| |
1165 |
| - | |
| 1167 | + | |
1166 | 1168 |
| |
1167 | 1169 |
| |
1168 | 1170 |
| |
1169 | 1171 |
| |
1170 |
| - | |
| 1172 | + | |
1171 | 1173 |
| |
1172 |
| - | |
| 1174 | + | |
1173 | 1175 |
| |
1174 | 1176 |
| |
1175 | 1177 |
| |
| |||
1469 | 1471 |
| |
1470 | 1472 |
| |
1471 | 1473 |
| |
| 1474 | + | |
1472 | 1475 |
| |
1473 | 1476 |
| |
1474 | 1477 |
| |
| |||
1530 | 1533 |
| |
1531 | 1534 |
| |
1532 | 1535 |
| |
1533 |
| - | |
1534 |
| - | |
1535 |
| - | |
1536 |
| - | |
1537 |
| - | |
1538 |
| - | |
1539 |
| - | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
1540 | 1544 |
| |
1541 | 1545 |
| |
1542 |
| - | |
| 1546 | + | |
1543 | 1547 |
| |
1544 | 1548 |
| |
1545 | 1549 |
| |
1546 | 1550 |
| |
1547 | 1551 |
| |
1548 | 1552 |
| |
1549 | 1553 |
| |
1550 |
| - | |
| 1554 | + | |
1551 | 1555 |
| |
| 1556 | + | |
1552 | 1557 |
| |
1553 | 1558 |
| |
1554 | 1559 |
| |
| |||
2951 | 2956 |
| |
2952 | 2957 |
| |
2953 | 2958 |
| |
| 2959 | + | |
2954 | 2960 |
| |
2955 | 2961 |
| |
2956 | 2962 |
| |
| |||
3014 | 3020 |
| |
3015 | 3021 |
| |
3016 | 3022 |
| |
3017 |
| - | |
3018 |
| - | |
3019 |
| - | |
3020 |
| - | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
3021 | 3026 |
| |
3022 |
| - | |
| 3027 | + | |
3023 | 3028 |
| |
3024 | 3029 |
| |
3025 | 3030 |
| |
| |||
3054 | 3059 |
| |
3055 | 3060 |
| |
3056 | 3061 |
| |
3057 |
| - | |
| 3062 | + | |
| 3063 | + | |
3058 | 3064 |
| |
3059 | 3065 |
| |
3060 | 3066 |
| |
|
Lines changed: 15 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1564 | 1564 |
| |
1565 | 1565 |
| |
1566 | 1566 |
| |
1567 |
| - | |
1568 |
| - | |
| 1567 | + | |
| 1568 | + | |
1569 | 1569 |
| |
1570 | 1570 |
| |
1571 |
| - | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
1572 | 1575 |
| |
1573 | 1576 |
| |
1574 | 1577 |
| |
1575 | 1578 |
| |
1576 | 1579 |
| |
1577 | 1580 |
| |
1578 | 1581 |
| |
1579 |
| - | |
| 1582 | + | |
1580 | 1583 |
| |
1581 |
| - | |
| 1584 | + | |
1582 | 1585 |
| |
1583 | 1586 |
| |
1584 | 1587 |
| |
1585 | 1588 |
| |
1586 | 1589 |
| |
1587 |
| - | |
1588 |
| - | |
| 1590 | + | |
| 1591 | + | |
1589 | 1592 |
| |
1590 |
| - | |
| 1593 | + | |
1591 | 1594 |
| |
1592 |
| - | |
| 1595 | + | |
1593 | 1596 |
| |
1594 | 1597 |
| |
1595 | 1598 |
| |
1596 |
| - | |
| 1599 | + | |
1597 | 1600 |
| |
1598 |
| - | |
1599 |
| - | |
| 1601 | + | |
| 1602 | + | |
1600 | 1603 |
| |
1601 | 1604 |
| |
1602 | 1605 |
| |
|
Lines changed: 16 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2293 | 2293 |
| |
2294 | 2294 |
| |
2295 | 2295 |
| |
| 2296 | + | |
2296 | 2297 |
| |
2297 | 2298 |
| |
2298 | 2299 |
| |
| |||
2318 | 2319 |
| |
2319 | 2320 |
| |
2320 | 2321 |
| |
2321 |
| - | |
2322 |
| - | |
2323 |
| - | |
2324 |
| - | |
2325 |
| - | |
2326 |
| - | |
2327 |
| - | |
2328 |
| - | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
2329 | 2333 |
| |
2330 |
| - | |
| 2334 | + | |
2331 | 2335 |
| |
2332 | 2336 |
| |
2333 | 2337 |
| |
2334 | 2338 |
| |
2335 |
| - | |
| 2339 | + | |
2336 | 2340 |
| |
2337 | 2341 |
| |
| 2342 | + | |
| 2343 | + | |
2338 | 2344 |
| |
2339 | 2345 |
| |
2340 | 2346 |
| |
|
0 commit comments
Comments
(0)