aboutsummaryrefslogtreecommitdiff
path: root/gold/options.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-10-07 18:06:27 +0000
committerIan Lance Taylor <iant@google.com>2007-10-07 18:06:27 +0000
commit8486ee48e830d61eff9da26b30527780a584556a (patch)
treed91b05eee78c126b70d9ccd2e745dff0480e86bf /gold/options.cc
parentf958d5fc533970eb5f7083c3ab791912ee499bd4 (diff)
downloadfsf-binutils-gdb-8486ee48e830d61eff9da26b30527780a584556a.zip
fsf-binutils-gdb-8486ee48e830d61eff9da26b30527780a584556a.tar.gz
fsf-binutils-gdb-8486ee48e830d61eff9da26b30527780a584556a.tar.bz2
Add --version option.
Diffstat (limited to 'gold/options.cc')
-rw-r--r--gold/options.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/gold/options.cc b/gold/options.cc
index f49b9f5..4ddb1ac 100644
--- a/gold/options.cc
+++ b/gold/options.cc
@@ -220,6 +220,16 @@ help(int, char**, char*, gold::Command_line*)
return 0;
}
+// Report version information.
+
+int
+version(int, char**, char* opt, gold::Command_line*)
+{
+ gold::print_version(opt[0] == 'v' && opt[1] == '\0');
+ gold::gold_exit(true);
+ return 0;
+}
+
// If the default sysroot is relocatable, try relocating it based on
// the prefix FROM.
@@ -351,7 +361,9 @@ options::Command_line_options::options[] =
NULL, TWO_DASHES,
&Position_dependent_options::clear_whole_archive),
SPECIAL('\0', "help", N_("Report usage information"), NULL,
- TWO_DASHES, &help)
+ TWO_DASHES, &help),
+ SPECIAL('v', "version", N_("Report version information"), NULL,
+ TWO_DASHES, &version)
};
const int options::Command_line_options::options_size =