Group
clap.Group
dataclass
Group(
title: str,
about: Optional[str] = None,
long_about: Optional[str] = None,
conflict_handler: Optional[str] = None,
)
Family of related arguments.
Example:
from pathlib import Path
import clap
from clap import Group, arg
@clap.command
class Cli(clap.Parser):
output_options = Group("Output Options")
"""Configure output settings."""
output_dir: Path = arg(long="output", group=output_options, value_name="DIR")
"""Path to output directory"""
Attributes:
-
about(Optional[str]) –The group's description for the short help (
-h). -
conflict_handler(Optional[str]) –The strategy for resolving conflicting optionals within this group.
-
long_about(Optional[str]) –The group's description for the long help (
--help). -
title(str) –The title for the argument group in the help output.
about
class-attribute
instance-attribute
The group's description for the short help (-h).
If Group.long_about is not specified,
this message will be displayed for --help.
conflict_handler
class-attribute
instance-attribute
The strategy for resolving conflicting optionals within this group.
This is forwarded to argparse.
long_about
class-attribute
instance-attribute
The group's description for the long help (--help).
If not set, Group.about will be used for long help in
addition to short help (-h).