summaryrefslogtreecommitdiff
path: root/gcc/ada/gnatxref.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-31 10:19:18 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-31 10:19:18 +0000
commita723873ac68caf7f6355582fd214698aff9173d0 (patch)
treec8c87d18a9109794633d5e936943a3f76d7e949f /gcc/ada/gnatxref.adb
parent0fc62fac18791458a32a16fc74766c775ddd6a34 (diff)
downloadgcc-a723873ac68caf7f6355582fd214698aff9173d0.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127967 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gnatxref.adb')
-rw-r--r--gcc/ada/gnatxref.adb37
1 files changed, 26 insertions, 11 deletions
diff --git a/gcc/ada/gnatxref.adb b/gcc/ada/gnatxref.adb
index 840587dfd28..859b984c418 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;