===================================================================
@@ -3026,9 +3026,10 @@
---------------
procedure Set_Usage
- (Config : in out Command_Line_Configuration;
- Usage : String := "[switches] [arguments]";
- Help : String := "")
+ (Config : in out Command_Line_Configuration;
+ Usage : String := "[switches] [arguments]";
+ Help : String := "";
+ Help_Msg : String := "")
is
begin
if Config = null then
@@ -3036,8 +3037,9 @@
end if;
Free (Config.Usage);
- Config.Usage := new String'(Usage);
- Config.Help := new String'(Help);
+ Config.Usage := new String'(Usage);
+ Config.Help := new String'(Help);
+ Config.Help_Msg := new String'(Help_Msg);
end Set_Usage;
------------------
@@ -3222,12 +3224,15 @@
& " [switches] [arguments]");
end if;
- Display_Section_Help ("");
-
- if Config.Sections /= null and then Config.Switches /= null then
- for S in Config.Sections'Range loop
- Display_Section_Help (Config.Sections (S).all);
- end loop;
+ if Config.Help_Msg /= null and then Config.Help_Msg.all /= "" then
+ Put_Line (Config.Help_Msg.all);
+ else
+ Display_Section_Help ("");
+ if Config.Sections /= null and then Config.Switches /= null then
+ for S in Config.Sections'Range loop
+ Display_Section_Help (Config.Sections (S).all);
+ end loop;
+ end if;
end if;
end Display_Help;
===================================================================
@@ -664,11 +664,14 @@
-- Output is always initialized to the empty string.
procedure Set_Usage
- (Config : in out Command_Line_Configuration;
- Usage : String := "[switches] [arguments]";
- Help : String := "");
+ (Config : in out Command_Line_Configuration;
+ Usage : String := "[switches] [arguments]";
+ Help : String := "";
+ Help_Msg : String := "");
-- Defines the general format of the call to the application, and a short
- -- help text. These are both displayed by Display_Help
+ -- help text. These are both displayed by Display_Help. When a non-empty
+ -- Help_Msg is given, it is used by Display_Help instead of the
+ -- automatically generated list of supported switches.
procedure Display_Help (Config : Command_Line_Configuration);
-- Display the help for the tool (ie its usage, and its supported switches)
@@ -1134,6 +1137,7 @@
Aliases : Alias_Definitions_List;
Usage : GNAT.OS_Lib.String_Access;
Help : GNAT.OS_Lib.String_Access;
+ Help_Msg : GNAT.OS_Lib.String_Access;
Switches : Switch_Definitions_List;
-- List of expected switches (Used when expanding switch groups)
end record;