diff --git a/src/clic-subcommand-instance.adb b/src/clic-subcommand-instance.adb index 6646c2b..31f9b0a 100644 --- a/src/clic-subcommand-instance.adb +++ b/src/clic-subcommand-instance.adb @@ -406,7 +406,8 @@ package body CLIC.Subcommand.Instance is -- Display_Usage -- ------------------- - procedure Display_Usage (Cmd : not null Command_Access) is + procedure Display_Usage (Cmd : not null Command_Access) + is Config : Switches_Configuration; Canary1 : Switches_Configuration; Canary2 : Switches_Configuration; @@ -444,7 +445,9 @@ package body CLIC.Subcommand.Instance is Display_Options (Config, "OPTIONS"); - Display_Global_Options; + if Global_Options_In_subcommand_help then + Display_Global_Options; + end if; -- Format and print the long command description Put_Line (""); diff --git a/src/clic-subcommand-instance.ads b/src/clic-subcommand-instance.ads index 1bf03cc..1c20458 100644 --- a/src/clic-subcommand-instance.ads +++ b/src/clic-subcommand-instance.ads @@ -28,6 +28,10 @@ generic with function TTY_Underline (Str : String) return String; with function TTY_Emph (Str : String) return String; + Global_Options_In_subcommand_help : Boolean := True; + -- When listing help for a subcommand, also include a section on global + -- options (that apply to all subcommands). + package CLIC.Subcommand.Instance is procedure Register (Cmd : not null Command_Access); @@ -84,6 +88,8 @@ package CLIC.Subcommand.Instance is procedure Display_Usage (Displayed_Error : Boolean := False); procedure Display_Help (Keyword : String); + -- Print help about a subcommand or topic. If Global_Option, list global + -- switches in addition to switches specific to the Keyword subcommand. Error_No_Command : exception; Command_Already_Defined : exception;