diff options
author | Cary Coutant <ccoutant@gmail.com> | 2016-11-22 15:44:56 -0800 |
---|---|---|
committer | Cary Coutant <ccoutant@gmail.com> | 2016-11-22 15:46:34 -0800 |
commit | 358a971863e93cbafa9e864b4db4d5448b960304 (patch) | |
tree | 4b3a85e4b2f2709fc1fbc54d81b523d9aa872c92 /gold/options.cc | |
parent | ca3cbe5cd7715d1559d55f8e71be1dd7340f13b1 (diff) | |
download | gdb-358a971863e93cbafa9e864b4db4d5448b960304.zip gdb-358a971863e93cbafa9e864b4db4d5448b960304.tar.gz gdb-358a971863e93cbafa9e864b4db4d5448b960304.tar.bz2 |
Print the default for all binary options; clean up --help output.
gold/
PR gold/20346
* options.cc (One_option::print): Print "(default)" when appropriate.
* options.h: Clean up and re-sort options.
(One_option::is_default): New data member.
(One_option::One_option): Add is_default parameter; adjust all calls.
(DEFINE_var): Add is_default__ parameter; adjust all calls.
(DEFINE_bool): Set is_default based on default_value__.
(DEFINE_bool_ignore): New macro.
(--no-eh-frame-hdr): New option.
(--enable-new-dtags): Remove mention of DT_FLAGS.
Diffstat (limited to 'gold/options.cc')
-rw-r--r-- | gold/options.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gold/options.cc b/gold/options.cc index 99fb3b6..73a3f67 100644 --- a/gold/options.cc +++ b/gold/options.cc @@ -146,8 +146,10 @@ One_option::print() const for (; len < 30; ++len) std::putchar(' '); - // TODO: if we're boolean, add " (default)" when appropriate. - printf("%s\n", gettext(this->helpstring)); + printf("%s", gettext(this->helpstring)); + if (this->is_default) + printf(" (%s)", _("default")); + printf("\n"); } void @@ -876,7 +878,7 @@ parse_short_option(int argc, const char** argv, int pos_in_argv_i, // We handle -z as a special case. static gold::options::One_option dash_z("", gold::options::DASH_Z, 'z', "", NULL, "Z-OPTION", false, - NULL); + NULL, false); gold::options::One_option* retval = NULL; if (this_argv[pos_in_argv_i] == 'z') retval = &dash_z; |