diff options
author | Vincent Celier <celier@adacore.com> | 2007-08-31 12:19:18 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-08-31 12:19:18 +0200 |
commit | 41c8951a8d4f38efb8a3550195aac0e3c68cfbe5 (patch) | |
tree | c8c87d18a9109794633d5e936943a3f76d7e949f /gcc/ada/gnatxref.adb | |
parent | c66bc9cc91b859926122b611e577b61c401e1e3e (diff) | |
download | gcc-41c8951a8d4f38efb8a3550195aac0e3c68cfbe5.zip gcc-41c8951a8d4f38efb8a3550195aac0e3c68cfbe5.tar.gz gcc-41c8951a8d4f38efb8a3550195aac0e3c68cfbe5.tar.bz2 |
re PR ada/4720 (GNAT programs do not support --help and --version)
2007-08-30 Vincent Celier <celier@adacore.com>
PR ada/4720
* gnatchop.adb, gnatfind.adb, gnatlink.adb, gnatls.adb,
gnatname.adb, gnatxref.adb, gprep.adb, clean.adb gnatbind.adb
(Check_Version_And_Help): New procedure in package Switch to process
switches --version and --help.
Use Check_Version_And_Help in GNAT tools
* make.adb: Ditto.
(Compile_Sources): Make sure that sources that are "excluded" are not
compiled.
(Gnatmake): Do not issue -aO. to gnatbind and only issue -I- if a
project file is used.
(Version_Switch): Remove, moved to Switch
(Help_Switch): Remove, moved to Switch
(Display_Version): Remove, moved to Switch
* switch.ads, switch.adb (Check_Version_And_Help): New procedure in
package Switch to process switches --version and --help.
(Display_Version): New procedure
* gnatvsn.ads, gnatvsn.adb (Copyright_Holder): New function.
From-SVN: r127967
Diffstat (limited to 'gcc/ada/gnatxref.adb')
-rw-r--r-- | gcc/ada/gnatxref.adb | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/gcc/ada/gnatxref.adb b/gcc/ada/gnatxref.adb index 840587d..859b984 100644 --- a/gcc/ada/gnatxref.adb +++ b/gcc/ada/gnatxref.adb @@ -24,13 +24,12 @@ -- -- ------------------------------------------------------------------------------ -with Xr_Tabls; use Xr_Tabls; -with Xref_Lib; use Xref_Lib; +with Opt; with Osint; use Osint; with Types; use Types; - -with Gnatvsn; -with Opt; +with Switch; use Switch; +with Xr_Tabls; use Xr_Tabls; +with Xref_Lib; use Xref_Lib; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Text_IO; use Ada.Text_IO; @@ -57,6 +56,9 @@ procedure Gnatxref is procedure Parse_Cmd_Line; -- Parse every switch on the command line + procedure Usage; + -- Display the usage + procedure Write_Usage; -- Print a small help page for program usage @@ -66,6 +68,10 @@ procedure Gnatxref is procedure Parse_Cmd_Line is begin + -- First check for --version or --help + + Check_Version_And_Help ("GNATXREF", "1998", Usage'Unrestricted_Access); + loop case GNAT.Command_Line.Getopt @@ -205,14 +211,12 @@ procedure Gnatxref is Write_Usage; end Parse_Cmd_Line; - ----------------- - -- Write_Usage -- - ----------------- + ----------- + -- Usage -- + ----------- - procedure Write_Usage is + procedure Usage is begin - Put_Line ("GNATXREF " & Gnatvsn.Gnat_Version_String); - Put_Line ("Copyright 1998-2005, AdaCore"); Put_Line ("Usage: gnatxref [switches] file1 file2 ..."); New_Line; Put_Line (" file ... list of source files to xref, " & @@ -238,6 +242,17 @@ procedure Gnatxref is Put_Line (" -v Print a 'tags' file for vi"); New_Line; + end Usage; + + ----------------- + -- Write_Usage -- + ----------------- + + procedure Write_Usage is + begin + Display_Version ("GNATXREF", "1998"); + New_Line; + Usage; raise Usage_Error; end Write_Usage; |