pub struct ClapArgGroup {
pub id: String,
pub args: Vec<String>,
pub required: bool,
pub multiple: bool,
}Expand description
One clap ArgGroup visible on a single command node at schema extraction.
Populated from Command::get_groups() and emitted on MCP tools as meta.clapMcp.argGroups
(plus an optional parse-time sentence on the tool description). Hints are advisory:
clap argv parse remains authoritative and invalid combinations still fail at parse time.
§Limitations
- Not JSON Schema — does not add
oneOf/anyOftoinputSchema; do not treatargGroupsas machine-enforced constraints. - Per command node —
argslists MCP-visible arg ids on this command node only. Parent or sibling subcommand groups are not merged into leaf tools. - Visibility —
argsuses the same MCP visibility filter as schema/inputSchema(builtins andskip_args; hidden args follow whatever that filter does today). - Sub-two-member groups — groups with fewer than two visible members are omitted.
§Semantics
required and multiple mirror clap ArgGroup flags at schema extraction time.
For required: true, agents should supply one member; for optional groups, at most one
unless multiple is true.
Fields§
§id: Stringclap ArgGroup id (ArgGroup::get_id()).
args: Vec<String>MCP-visible arg ids on this command node (after skip/builtin filtering).
required: boolWhether the group is required at parse time (ArgGroup::is_required_set()).
multiple: boolWhether multiple members may be set (ArgGroup::is_multiple()).
Trait Implementations§
Source§impl Clone for ClapArgGroup
impl Clone for ClapArgGroup
Source§fn clone(&self) -> ClapArgGroup
fn clone(&self) -> ClapArgGroup
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClapArgGroup
impl Debug for ClapArgGroup
Source§impl<'de> Deserialize<'de> for ClapArgGroup
impl<'de> Deserialize<'de> for ClapArgGroup
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ClapArgGroup
Source§impl PartialEq for ClapArgGroup
impl PartialEq for ClapArgGroup
Source§fn eq(&self, other: &ClapArgGroup) -> bool
fn eq(&self, other: &ClapArgGroup) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ClapArgGroup
impl Serialize for ClapArgGroup
impl StructuralPartialEq for ClapArgGroup
Auto Trait Implementations§
impl Freeze for ClapArgGroup
impl RefUnwindSafe for ClapArgGroup
impl Send for ClapArgGroup
impl Sync for ClapArgGroup
impl Unpin for ClapArgGroup
impl UnsafeUnpin for ClapArgGroup
impl UnwindSafe for ClapArgGroup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.