diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-05 23:41:00 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-05 23:41:00 +0000 |
commit | 1353d9f74da1d0abfcb3c790352dde5cf5f31a01 (patch) | |
tree | d4a4a93914e1c41a8f3f7e9b66d5a2e9ca0a0bac /gcc/toplev.c | |
parent | c677d652f0a03564b77399d84deb558a3c519656 (diff) | |
download | gcc-1353d9f74da1d0abfcb3c790352dde5cf5f31a01.tar.gz |
* cpplib.h (struct cpp_reader): Add help_only field.
* cppinit.c (COMMAND_LINE_OPTIONS): Add OPT_version.
(cpp_handle_option): Set pfile->help_only if we see -h,
--help, -target-help, or --version. Print version string but
do not set help_only if we see -v or -version. Make text
printed by -v match that printed by (-)-version.
* cppmain.c (main): Exit after option parsing if
pfile->help_only is true.
* toplev.c (independent_decode_option): Call print_version,
then exit, if we see --version (but not -version).
(print_version): Split lengthy message into two lines.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38733 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 9e101860d8a..671ce2cd5d6 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -4340,6 +4340,12 @@ independent_decode_option (argc, argv) exit (0); } + if (!strcmp (arg, "-version")) + { + print_version (stderr, ""); + exit (0); + } + if (*arg == 'Y') arg++; @@ -4934,12 +4940,13 @@ print_version (file, indent) #endif fnotice (file, #ifdef __GNUC__ - "%s%s%s version %s (%s) compiled by GNU C version %s.\n" + "%s%s%s version %s (%s)\n%s\tcompiled by GNU C version %s.\n" #else "%s%s%s version %s (%s) compiled by CC.\n" #endif , indent, *indent != 0 ? " " : "", - language_string, version_string, TARGET_NAME, __VERSION__); + language_string, version_string, TARGET_NAME, + indent, __VERSION__); } /* Print an option value and return the adjusted position in the line. |