diff --git a/src/client/commands/drop_db.rs b/src/client/commands/drop_db.rs index 968b154..f03fe43 100644 --- a/src/client/commands/drop_db.rs +++ b/src/client/commands/drop_db.rs @@ -19,7 +19,8 @@ use crate::{ #[derive(Parser, Debug, Clone)] pub struct DropDbArgs { /// The MySQL database(s) to drop - #[arg(num_args = 1.., add = ArgValueCompleter::new(mysql_database_completer))] + #[arg(num_args = 1..)] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_database_completer)))] name: Vec, /// Print the information as JSON diff --git a/src/client/commands/drop_user.rs b/src/client/commands/drop_user.rs index f0adb3a..5c9adb1 100644 --- a/src/client/commands/drop_user.rs +++ b/src/client/commands/drop_user.rs @@ -19,7 +19,8 @@ use crate::{ #[derive(Parser, Debug, Clone)] pub struct DropUserArgs { /// The MySQL user(s) to drop - #[arg(num_args = 1.., add = ArgValueCompleter::new(mysql_user_completer))] + #[arg(num_args = 1..)] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))] username: Vec, /// Print the information as JSON diff --git a/src/client/commands/edit_privs.rs b/src/client/commands/edit_privs.rs index 853d1e0..29c213b 100644 --- a/src/client/commands/edit_privs.rs +++ b/src/client/commands/edit_privs.rs @@ -29,7 +29,7 @@ use crate::{ #[derive(Parser, Debug, Clone)] pub struct EditPrivsArgs { /// The MySQL database to edit privileges for - #[arg(add = ArgValueCompleter::new(mysql_database_completer))] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_database_completer)))] pub name: Option, #[arg( diff --git a/src/client/commands/lock_user.rs b/src/client/commands/lock_user.rs index a59ccc8..5490427 100644 --- a/src/client/commands/lock_user.rs +++ b/src/client/commands/lock_user.rs @@ -17,8 +17,9 @@ use crate::{ #[derive(Parser, Debug, Clone)] pub struct LockUserArgs { - /// The MySQL user(s) to lock - #[arg(num_args = 1.., add = ArgValueCompleter::new(mysql_user_completer))] + /// The MySQL user(s) to loc + #[arg(num_args = 1..)] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))] username: Vec, /// Print the information as JSON diff --git a/src/client/commands/passwd_user.rs b/src/client/commands/passwd_user.rs index 50f28d7..1029240 100644 --- a/src/client/commands/passwd_user.rs +++ b/src/client/commands/passwd_user.rs @@ -22,7 +22,7 @@ use crate::{ #[derive(Parser, Debug, Clone)] pub struct PasswdUserArgs { /// The MySQL user whose password is to be changed - #[arg(add = ArgValueCompleter::new(mysql_user_completer))] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))] username: MySQLUser, /// Read the new password from a file instead of prompting for it diff --git a/src/client/commands/show_db.rs b/src/client/commands/show_db.rs index 939f6ab..cc16cdb 100644 --- a/src/client/commands/show_db.rs +++ b/src/client/commands/show_db.rs @@ -18,7 +18,8 @@ use crate::{ #[derive(Parser, Debug, Clone)] pub struct ShowDbArgs { /// The MySQL database(s) to show - #[arg(num_args = 0.., add = ArgValueCompleter::new(mysql_database_completer))] + #[arg(num_args = 0..)] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_database_completer)))] name: Vec, /// Print the information as JSON diff --git a/src/client/commands/show_privs.rs b/src/client/commands/show_privs.rs index cee76b7..d2b664e 100644 --- a/src/client/commands/show_privs.rs +++ b/src/client/commands/show_privs.rs @@ -19,7 +19,8 @@ use crate::{ #[derive(Parser, Debug, Clone)] pub struct ShowPrivsArgs { /// The MySQL database(s) to show privileges for - #[arg(num_args = 0.., add = ArgValueCompleter::new(mysql_database_completer))] + #[arg(num_args = 0..)] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_database_completer)))] name: Vec, /// Print the information as JSON diff --git a/src/client/commands/show_user.rs b/src/client/commands/show_user.rs index 566efb9..c4fcdba 100644 --- a/src/client/commands/show_user.rs +++ b/src/client/commands/show_user.rs @@ -18,7 +18,8 @@ use crate::{ #[derive(Parser, Debug, Clone)] pub struct ShowUserArgs { /// The MySQL user(s) to show - #[arg(num_args = 0.., add = ArgValueCompleter::new(mysql_user_completer))] + #[arg(num_args = 0..)] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))] username: Vec, /// Print the information as JSON diff --git a/src/client/commands/unlock_user.rs b/src/client/commands/unlock_user.rs index 6af1ac5..b509bcd 100644 --- a/src/client/commands/unlock_user.rs +++ b/src/client/commands/unlock_user.rs @@ -18,7 +18,8 @@ use crate::{ #[derive(Parser, Debug, Clone)] pub struct UnlockUserArgs { /// The MySQL user(s) to unlock - #[arg(num_args = 1.., add = ArgValueCompleter::new(mysql_user_completer))] + #[arg(num_args = 1..)] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))] username: Vec, /// Print the information as JSON diff --git a/src/client/mysql_admutils_compatibility/mysql_dbadm.rs b/src/client/mysql_admutils_compatibility/mysql_dbadm.rs index f2bc378..be5df62 100644 --- a/src/client/mysql_admutils_compatibility/mysql_dbadm.rs +++ b/src/client/mysql_admutils_compatibility/mysql_dbadm.rs @@ -130,21 +130,23 @@ pub struct CreateArgs { #[derive(Parser)] pub struct DatabaseDropArgs { /// The name of the DATABASE(s) to drop. - #[arg(num_args = 1.., add = ArgValueCompleter::new(mysql_database_completer))] + #[arg(num_args = 1..)] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_database_completer)))] name: Vec, } #[derive(Parser)] pub struct DatabaseShowArgs { /// The name of the DATABASE(s) to show. - #[arg(num_args = 0.., add = ArgValueCompleter::new(mysql_database_completer))] + #[arg(num_args = 0..)] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_database_completer)))] name: Vec, } #[derive(Parser)] pub struct EditPermArgs { /// The name of the DATABASE to edit permissions for. - #[arg(add = ArgValueCompleter::new(mysql_database_completer))] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_database_completer)))] pub database: MySQLDatabase, } diff --git a/src/client/mysql_admutils_compatibility/mysql_useradm.rs b/src/client/mysql_admutils_compatibility/mysql_useradm.rs index 314b616..74a52ab 100644 --- a/src/client/mysql_admutils_compatibility/mysql_useradm.rs +++ b/src/client/mysql_admutils_compatibility/mysql_useradm.rs @@ -93,21 +93,24 @@ pub struct CreateArgs { #[derive(Parser)] pub struct DeleteArgs { /// The name of the USER(s) to delete. - #[arg(num_args = 1.., add = ArgValueCompleter::new(mysql_user_completer))] + #[arg(num_args = 1..)] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))] name: Vec, } #[derive(Parser)] pub struct PasswdArgs { /// The name of the USER(s) to change the password for. - #[arg(num_args = 1.., add = ArgValueCompleter::new(mysql_user_completer))] + #[arg(num_args = 1..)] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))] name: Vec, } #[derive(Parser)] pub struct ShowArgs { /// The name of the USER(s) to show. - #[arg(num_args = 0.., add = ArgValueCompleter::new(mysql_user_completer))] + #[arg(num_args = 0..)] + #[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))] name: Vec, }