Add -version option to get just the version#4281
Conversation
|
No objection... the traditional impl of this
|
Should be merged after pull request bitcoin#4281 ("Add `-version` option to get just the version bitcoin#4281"), because is changed "--help" to "-help". Checked that grep of 'mapArgs.count("--' returned only three places that are fixed by pull request bitcoin#4281.
|
I noticed that the @Diapolo as a byproduct this also solves your remark about #4213, all HTML has been removed from the translation, the links are still clickable by means of a regexp. |
|
@laanwj That's a good thing, saves us some trouble I guess :). |
src/init.cpp
Outdated
There was a problem hiding this comment.
@Diapolo What I don't like about this is splitting the message over multiple translation messages "fragments". I'd prefer to have it one message (as it was with the about box) -- however, you can't rely on translators to insert newlines in the right place. So in that case we'd need an utility function to format it over multiple lines for the terminal. Sounds easy, until you start thinking locales...
There was a problem hiding this comment.
I think it's ok to split out things like the copyright notice or the "this is experimental software" notice. I think the easiest solution for proper newlines is to leave the first two messages seperate and combine the second paragraph into one message and the third paragraph in one message. Then only the two paragraphs need to be properly wordwraped, which is probably supported by some boost function.
There was a problem hiding this comment.
Boost has a function to do word wrapping, but alas it's deeply embedded in boost::program_options https://github.com/mousebird/boost/blob/master/libs/program_options/src/options_description.cpp
Anyhow it shouldn't be too difficult to write one ourselves...
|
Ok, I added a FormatParagraph function to resolve my above remark, should be ready for merge now. |
|
@TheBlueMatt Pulltester is broken, looks like the disk is full. |
Adds a `-version` or `--version` option to print just the version of the program for bitcoind, bitcoin-cli and bitcoin-qt. Also make it that `-help` can be used to display the help (as well as existing `--help`). Up to now, `-help` was the only option that didn't work with either one or two dashes.
This is to be used for the `-version` and `-help` messages.
|
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/9ba479a235c7ef57243f5de6538575a101fe03da for binaries and test log. |
|
@Diapolo Could you give this a try on windows? |
There was a problem hiding this comment.
Help me, why does this not need to be translated anymore?
There was a problem hiding this comment.
Because it's set in the code now.
|
Going to try that later :). |
src/init.cpp
Outdated
There was a problem hiding this comment.
Edit: This needs to become return FormatParagraph(strprintf(_("Copyright (C) 2009-%i, The Bitcoin Core Developers"), COPYRIGHT_YEAR)) + "\n\n" + to look really good IMHO :).
There was a problem hiding this comment.
I've removed the '.', I don't think the ',' between the year and the name makes sense (at least I don't think I've ever seen that before).
|
Appart from my nit above ACK! |
There was a problem hiding this comment.
No , is okay, but you should add another \n as it looks ugly to have the copyright string right before the next sentence (at least that's how it looks for me on Windows).
There was a problem hiding this comment.
Sorry, but where is it? The ones shown here were there before.
There was a problem hiding this comment.
sigh no, I added one just below here:
Adds a copyright and attribution message to the `-version` output (the same as shown in the About dialog in the GUI). Move the message to a function LicenseInfo in init.cpp.
They share so much code and functionality that they may as well be one class.
5c97aae qt: Unify AboutDialog and HelpMessageDialog (Wladimir J. van der Laan) 45615af Add 'about' information to `-version` output (Wladimir J. van der Laan) 97789d3 util: Add function FormatParagraph to format paragraph to fixed-width (Wladimir J. van der Laan) 96b733e Add `-version` option to get just the version (Wladimir J. van der Laan)
Should be merged after pull request bitcoin#4281 ("Add `-version` option to get just the version bitcoin#4281"), because is changed "--help" to "-help". Checked that grep of 'mapArgs.count("--' returned only three places that are fixed by pull request bitcoin#4281.
Should be merged after pull request bitcoin#4281 ("Add `-version` option to get just the version bitcoin#4281"), because is changed "--help" to "-help". Checked that grep of 'mapArgs.count("--' returned only three places that are fixed by pull request bitcoin#4281. (cherry picked from commit 71aaff3)
Adds a
-versionor--versionoption to print just the version of the program for bitcoind, bitcoin-cli and bitcoin-qt (almost every program on linux supports this, I've made the mistake of calling bitcoind with --version multiple times already, before deciding to finally add it).Also make it that
-helpcan be used to display the help (as well as existing--help). Up to now,-helpwas the only option that didn't work with either one or two dashes.Edit: maybe it's a good idea to add license information as well (for example,
lsdoes this too) as print the versions for dependency libraries such as OpenSSL, that would fix #1930.