summaryrefslogtreecommitdiff
path: root/gcc/ada/gnatxref.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gnatxref.adb')
-rw-r--r--gcc/ada/gnatxref.adb22
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/ada/gnatxref.adb b/gcc/ada/gnatxref.adb
index cbdf54a6d94..2912b4f5db1 100644
--- a/gcc/ada/gnatxref.adb
+++ b/gcc/ada/gnatxref.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -30,6 +30,7 @@ with Switch; use Switch;
with Xr_Tabls; use Xr_Tabls;
with Xref_Lib; use Xref_Lib;
+with Ada.Command_Line; use Ada.Command_Line;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Text_IO; use Ada.Text_IO;
@@ -209,7 +210,8 @@ procedure Gnatxref is
end if;
when others =>
- Write_Usage;
+ Put_Line ("type ""gnatxref --help"" for help");
+ raise Usage_Error;
end case;
end loop;
@@ -225,7 +227,8 @@ procedure Gnatxref is
if Ada.Strings.Fixed.Index (S, ":") /= 0 then
Ada.Text_IO.Put_Line
("Only file names are allowed on the command line");
- Write_Usage;
+ Put_Line ("type ""gnatxref --help"" for help");
+ raise Usage_Error;
end if;
Add_Xref_File (S);
@@ -237,12 +240,14 @@ procedure Gnatxref is
when GNAT.Command_Line.Invalid_Switch =>
Ada.Text_IO.Put_Line ("Invalid switch : "
& GNAT.Command_Line.Full_Switch);
- Write_Usage;
+ Put_Line ("type ""gnatxref --help"" for help");
+ raise Usage_Error;
when GNAT.Command_Line.Invalid_Parameter =>
Ada.Text_IO.Put_Line ("Parameter missing for : "
& GNAT.Command_Line.Full_Switch);
- Write_Usage;
+ Put_Line ("type ""gnatxref --help"" for help");
+ raise Usage_Error;
end Parse_Cmd_Line;
-----------
@@ -296,7 +301,12 @@ begin
Parse_Cmd_Line;
if not Have_File then
- Write_Usage;
+ if Argument_Count = 0 then
+ Write_Usage;
+ else
+ Put_Line ("type ""gnatxref --help"" for help");
+ raise Usage_Error;
+ end if;
end if;
Xr_Tabls.Set_Default_Match (True);