diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-07-17 08:12:09 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-07-17 08:12:09 +0200 |
commit | d2d8b2a70d792987761480ac14301816498a6454 (patch) | |
tree | dbf1a3f04bae9a8d171e9ca2a7b1aaec91d67569 /gcc/ada/gnatxref.adb | |
parent | 3fad4d00acc3ccc59e4d028eb94d759e9ed4c55f (diff) | |
download | gcc-d2d8b2a70d792987761480ac14301816498a6454.zip gcc-d2d8b2a70d792987761480ac14301816498a6454.tar.gz gcc-d2d8b2a70d792987761480ac14301816498a6454.tar.bz2 |
[multiple changes]
2014-07-17 Robert Dewar <dewar@adacore.com>
* exp_ch7.adb, exp_ch7.ads, sinfo.ads: Minor reformatting.
2014-07-17 Ed Schonberg <schonberg@adacore.com>
* sem_case.adb (Check_Choice_Set): If the case expression is the
expression in a predicate, do not recheck coverage against itself,
to prevent spurious errors.
* sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Indicate that
expression comes from an aspect specification, to prevent spurious
errors when expression is a case expression in a predicate.
2014-07-17 Pascal Obry <obry@adacore.com>
* adaint.c, adaint.h (__gnat_set_executable): Add mode parameter.
* s-os_lib.ads, s-os_lib.adb (Set_Executable): Add Mode parameter.
2014-07-17 Vincent Celier <celier@adacore.com>
* gnatchop.adb, make.adb, gnatbind.adb, clean.adb, gprep.adb,
gnatxref.adb, gnatls.adb, gnatfind.adb, gnatname.adb: Do not output
the usage for an erroneous invocation of a gnat tool.
From-SVN: r212716
Diffstat (limited to 'gcc/ada/gnatxref.adb')
-rw-r--r-- | gcc/ada/gnatxref.adb | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/ada/gnatxref.adb b/gcc/ada/gnatxref.adb index cbdf54a..2912b4f 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); |