1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00
pgbackrest/doc/xml
David Steele 45a4e801ed
Replace getopt_long() with custom implementation.
getopt_long() requires an exhaustive list of all possible options that may be found on the command line. Because of the way options are indexed (e.g. repo1-4, pg1-8) optionList[] has 827 entries and we have kept it small by curtailing the maximum indexes very severely. Another issue is that getopt_long() scans the array sequentially so parsing gets slower as the index maximums increase.

Replace getopt_long() with a custom implementation that behaves the same but allows options to be parsed with a function instead of using optionList[]. This commit leaves the list in place in order to focus on the getopt_long() replacement, but cfgParseOption() could be replaced with a more efficient implementation that removes the need for optionList[].

This implementation also fixes an issue where invalid options were misreported in the error message if they only had one dash, e.g. -config. This seems to have been some kind of problem in getopt_long(), but no investigation was done since the new implementation fixes it.

Tests were added at 0825428, 2b8d2da, 34dd663, and 384f247 to check that previously untested getopt_long() behavior doesn't change.
2021-05-20 16:02:31 -04:00
..
auto v2.33: Multi-Repository and GCS Support 2021-04-05 09:18:20 -04:00
dtd Update reference to include links to user guide examples. 2021-03-31 09:36:56 -04:00
coding.xml Add THIS_PUB() macro to simplify inline object accessors. 2021-04-13 16:58:02 -04:00
contributing.xml Move configuration definition to src/build/config/config.yaml. 2021-03-08 16:01:05 -05:00
documentation.xml Add RHEL/CentOS 8 documentation. 2020-12-04 10:59:57 -05:00
faq.xml Update the PITR FAQ to clarify the default behavior. 2020-06-12 11:27:18 -04:00
index.xml Multiple repository support. 2021-03-08 13:31:13 -05:00
metric.xml Add user guides for CentOS/RHEL 6/7. 2019-05-16 08:32:02 -04:00
reference.xml Add automatic GCS authentication for GCE instances. 2021-05-17 14:55:50 -04:00
release.xml Replace getopt_long() with custom implementation. 2021-05-20 16:02:31 -04:00
user-guide-index.xml Add RHEL/CentOS 8 documentation. 2020-12-04 10:59:57 -05:00
user-guide.xml Add automatic GCS authentication for GCE instances. 2021-05-17 14:55:50 -04:00