New option and configuration framework #394

pull sgimenez wants to merge 8 commits into bitcoin:master from sgimenez:program-options changing 22 files +803 −472
  1. sgimenez commented at 4:43 PM on July 9, 2011: contributor

    I'm pull-requesting this so that people know this stuff exists. Consider it as low priority, and If there's some interest in it, I might keep this up to date for some time.

    Pluses:

    • Command line and configuration files are fully parsed before being taken into account, errors are reported (including misspelled or unknown parameters).
    • A nice interface is provided to access options & configuration from source code (cf. option.h).
    • Single definition of options and default values, which have been moved to the top of .cpp files.
    • Checks for integer overflows in configuration values.
    • New rpc command "reloadconfig" to dynamically update configuration parameters (Issue #309). Command line parameters will not be overridden. Notice that many core parameters are used only during startup.
    • Option -conf is now enough to configure everything (Issue #140).
    • A way to force listing of hidden options (-help=allopts) and access to help messages is possible even if bitcoin is already running.
    • Fix erroneous error message with respect to the path of the configuration file when using -testnet (Issue #241).
    • Removed '\n' and other data from translatable strings (Issue #313).
    • Using boost to deal with most filesystem paths.
    • Slightly faster access to configuration values (no map lookups).

    Minuses:

    • Access to configuration values are a bit less recognizable in source code.
    • Relies a little deeper on boost (but without added dependencies).
    • Uses some hacks around boost::program_options to recover original bitcoin command line style.

    Notes:

    • This has been tested a little bit on unix (linux), needs to be tested on other arches (Windows).
  2. New option and configuration framework
    Pluses:
    - Command line and configuration files are fully parsed before being
      taken into account, errors are repported (including mispelled or
      unknown parameters).
    - A nice interface is provided to access options & configuration from
      source code (cf. option.h).
    - Single definition of options and default values, which have been
      moved to the top of .cpp files.
    - Checks for integer overflows in configuration values.
    - New rpc command "reloadconfig" to dynamically update configuration
      parameters (Issue #309). Command line parameters will not be overriden.
      Notice that many core parameters are used only during startup.
    - Option -conf is now enough to configure everything (Issue #140).
    - A way to force listing of hidden options (-help=allopts) and access to
      help messages is possible even if bitcoin is already running.
    - Fix erroneous error message with respect to the path of the
      configuration file when using -testnet (Issue #241).
    - Removed '\n' and other data from translatable strings (Issue #313).
    - Using boost to deal with most filesystem paths.
    - Slightly faster access to configuration values (no map lookups).
    
    Minuses:
    - Access to configuration values are a bit less recognizable in source
      code.
    - Relies a little deeper on boost (but without added dependencies).
    - Uses some hacks around boost::program_options to recover original
      bitcoin command line style.
    
    Notes:
    - This has been tested a litle bit on unix (linux), needs to be tested
      on other arches.
    f43f0d6bff
  3. Report configuration errors properly
    These reports should not rely on stderr only.
    A non-null exit code is required, especially when the program is used
    to send rpc commands.
    550b3f1004
  4. Fix and clarify buffer size units c24791ee1a
  5. More detailed option documentation 95d38e82bf
  6. Merge branch 'master' of git://github.com/bitcoin/bitcoin into program-options
    Conflicts:
    	src/init.cpp
    	src/makefile.linux-mingw
    	src/makefile.mingw
    	src/makefile.osx
    	src/makefile.unix
    	src/rpc.cpp
    	src/util.cpp
    	src/wallet.cpp
    43288bea72
  7. Miscellaneous and cosmetics for option framework 39f14de3d7
  8. Removing obsolete single instance check bb6412b1ea
  9. Merge commit 'bb6412b1eac75bf127769f5eb36378748e78d13f'; commit '4e5d88ce26b7829856e2' into program-options
    Conflicts:
    	src/init.cpp
    	src/makefile.vc
    04676e696a
  10. luke-jr commented at 1:17 PM on October 13, 2011: member

    Would be better to use a library like getopt IMO.

  11. jgarzik commented at 7:50 PM on December 20, 2011: contributor
    1. this is an unusual arrangement of command line parsing
    2. it is not clear that the code is moving in the right direction ("improvement!"), but instead, winds up adding a bunch of symbols to the global namespace for little added value

    Closing for these reasons, as well as outdatedness.

  12. jgarzik closed this on Dec 20, 2011

  13. ptschip referenced this in commit a869b01024 on Apr 24, 2017
  14. classesjack referenced this in commit b85e0a725f on Jan 2, 2018
  15. Losangelosgenetics referenced this in commit 1f135b6b01 on Mar 12, 2020
  16. rajarshimaitra referenced this in commit 7da1cb7018 on Aug 5, 2021
  17. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me