diff options
author | Ian Lance Taylor <iant@google.com> | 2007-10-07 18:06:27 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-10-07 18:06:27 +0000 |
commit | 8486ee48e830d61eff9da26b30527780a584556a (patch) | |
tree | d91b05eee78c126b70d9ccd2e745dff0480e86bf /gold/options.cc | |
parent | f958d5fc533970eb5f7083c3ab791912ee499bd4 (diff) | |
download | fsf-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.cc | 14 |
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 = |