Add command-line option to show version only and exit #2669

pull nmarley wants to merge 1 commits into bitcoin:master from nmarley:master changing 1 files +11 −0
  1. nmarley commented at 11:15 PM on May 18, 2013: contributor

    Adds -v and --version options to bitcoind (or Bitcoin-Qt) executable in order to print the version number and exit.

    Currently the version can be discovered via -?, but that option gives a long usage message which isn't relevant if all you want to know is the version. (I can see sysadmins using this in scripts for leveling/upgrading bitcoind across multiple servers).

  2. Add option to show version and exit 887ca8c9a7
  3. BitcoinPullTester commented at 11:51 PM on May 18, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/887ca8c9a7a1e1da5ca2704815d4425801b00a22 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  4. Diapolo commented at 1:18 AM on May 19, 2013: none

    This will not show up for Bitcoin-Qt as your code is in between #if !defined(QT_GUI). For Qt you would need such a thing in bitcoin.cpp via a to be defined GUIUtil::VersionMessageBox.

  5. nmarley commented at 2:00 AM on May 19, 2013: contributor

    It is compiled into Bitcoin-Qt as well. It is in the same place as the --help option in the code.

    The output below is from Bitcoin-Qt on OSX. You can see from the output the --help option exists there. This change will do the same thing, except show only the version.

    ~ % /Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt --help
    Bitcoin-Qt version v0.8.1-beta
    
    Usage:
      bitcoin-qt [command-line options]
    
    Options:
      -?                     This help message
      -conf=<file>           Specify configuration file (default: bitcoin.conf)
      -pid=<file>            Specify pid file (default: bitcoind.pid)
    
  6. luke-jr commented at 4:52 AM on May 22, 2013: member

    -v should be some kind of verbose flag usually... -V seems better for --version

  7. laanwj commented at 9:59 AM on May 24, 2013: member

    Agree with @luke-jr here

  8. schildbach commented at 11:37 AM on May 24, 2013: contributor

    Agree also with @luke-jr . "-v" should be reserved for "--verbose".

  9. Diapolo commented at 12:20 PM on May 24, 2013: none

    @laanwj I still think this won't work for Bitcoin-Qt, see my comments above about --help.

  10. nmarley commented at 2:13 PM on May 24, 2013: contributor

    I had to get my development environment setup to compile Bitcoin-Qt. I have now verified this won't work for Bitcoin-Qt.

    Thanks Philip. I am closing this pull request.

  11. nmarley closed this on May 24, 2013

  12. laanwj commented at 2:26 PM on May 24, 2013: member

    @nmarley no need to close the issue, you can re-push to the same branch after you've fixed it and it will show up here

  13. 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-29 03:16 UTC

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