use clap::Subcommand;

#[derive(Subcommand)]
pub enum UserAction {
    /// Search users by name or email
    Search {
        /// Search query
        query: String,
        /// Show extended details (groups, login status)
        #[arg(long)]
        details: bool,
    },
    /// Create a new user
    Create {
        /// User email
        #[arg(long)]
        email: String,
        /// Login name (required on Bugzilla 5.3+ when `use_email_as_login` is disabled;
        /// set `api_mode` to "hybrid" to use XML-RPC which avoids the REST login field conflict)
        #[arg(long)]
        login: Option<String>,
        /// Full name
        #[arg(long)]
        full_name: Option<String>,
        /// Password (optional, generated by server if omitted)
        #[arg(long)]
        password: Option<String>,
    },
    /// Update a user
    Update {
        /// User ID or login name
        user: String,
        /// New real name
        #[arg(long)]
        real_name: Option<String>,
        /// New email
        #[arg(long)]
        email: Option<String>,
        /// Disable login
        #[arg(long)]
        disable_login: Option<bool>,
        /// Custom login denied message (used with --disable-login)
        #[arg(long)]
        login_denied_text: Option<String>,
    },
}
