Skip to content

How to implement a command similar to git branch #5674

Answered by epage
okou19900722 asked this question in Q&A
Discussion options

You must be logged in to vote

If I understand git branch correctly, -D is a flag, rather than an option, so this would be

#[derive(Parser)]
struct Branch {
    #[arg(short = 'D')]
    delete: bool,
    name: Option<String>,
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@okou19900722
Comment options

Answer selected by okou19900722
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants