Use arggroup from item_id #27

Closed
opened 3 months ago by glitch4347 · 1 comments
Collaborator
#[command(group(
    ArgGroup::new("item")
        .required(true)
        .args(&["item_id", "item_number"]),
))]
struct Args {
    /// The ID of the item
    #[arg(long = "item_id", required = false)]
    item_id: Option<String>,

    /// The number of the item
    #[arg(short = 'n', long = "item_number", required = false)]
    item_number: Option<u32>,
}

this is example how you can use argGroup , so it's better that how used -n or item_id

```rust #[command(group( ArgGroup::new("item") .required(true) .args(&["item_id", "item_number"]), ))] struct Args { /// The ID of the item #[arg(long = "item_id", required = false)] item_id: Option<String>, /// The number of the item #[arg(short = 'n', long = "item_number", required = false)] item_number: Option<u32>, } ``` this is example how you can use argGroup , so it's better that how used -n or item_id
Poster
Collaborator
https://code.corpglory.net/corpglory/mps/pulls/28
glitch4347 closed this issue 3 months ago
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.