/** * Sets the map of section keys and renderers used to construct the usage help message. * <p>The specified setting will be registered with this {@code CommandLine} and the full hierarchy of its * subcommands and nested sub-subcommands <em>at the moment this method is called</em>. Subcommands added * later will have the default setting. To ensure a setting is applied to all * subcommands, call the setter last, after adding subcommands.</p> * <p>Use {@link UsageMessageSpec#sectionMap(Map)} to customize a command without affecting its subcommands.</p> * @see #getHelpSectionMap * @since 3.9 */ public CommandLine setHelpSectionMap(Map<String, IHelpSectionRenderer> map) { getCommandSpec().usageMessage().sectionMap(map); for (CommandLine command : getCommandSpec().subcommands().values()) { command.setHelpSectionMap(map); } return this; }
/** * Sets the map of section keys and renderers used to construct the usage help message. * <p>The specified setting will be registered with this {@code CommandLine} and the full hierarchy of its * subcommands and nested sub-subcommands <em>at the moment this method is called</em>. Subcommands added * later will have the default setting. To ensure a setting is applied to all * subcommands, call the setter last, after adding subcommands.</p> * <p>Use {@link UsageMessageSpec#sectionMap(Map)} to customize a command without affecting its subcommands.</p> * @see #getHelpSectionMap * @since 3.9 */ public CommandLine setHelpSectionMap(Map<String, IHelpSectionRenderer> map) { getCommandSpec().usageMessage().sectionMap(map); for (CommandLine command : getCommandSpec().subcommands().values()) { command.setHelpSectionMap(map); } return this; }
/** * Returns the map of section keys and renderers used to construct the usage help message. * The usage help message can be customized by adding, replacing and removing section renderers from this map. * Sections can be reordered with {@link #setHelpSectionKeys(List) setSectionKeys}. * Sections that are either not in this map or not in the list returned by {@link #getHelpSectionKeys() getSectionKeys} are omitted. * <p> * NOTE: By modifying the returned {@code Map}, only the usage help message <em>of this command</em> is affected. * Use {@link #setHelpSectionMap(Map)} to customize the usage help message for this command <em>and all subcommands</em>. * </p> * @since 3.9 */ public Map<String, IHelpSectionRenderer> getHelpSectionMap() { return getCommandSpec().usageMessage().sectionMap(); }
/** * Returns the map of section keys and renderers used to construct the usage help message. * The usage help message can be customized by adding, replacing and removing section renderers from this map. * Sections can be reordered with {@link #setHelpSectionKeys(List) setSectionKeys}. * Sections that are either not in this map or not in the list returned by {@link #getHelpSectionKeys() getSectionKeys} are omitted. * <p> * NOTE: By modifying the returned {@code Map}, only the usage help message <em>of this command</em> is affected. * Use {@link #setHelpSectionMap(Map)} to customize the usage help message for this command <em>and all subcommands</em>. * </p> * @since 3.9 */ public Map<String, IHelpSectionRenderer> getHelpSectionMap() { return getCommandSpec().usageMessage().sectionMap(); }