Misc. clap improvements, , more accurate value names, ...
This commit is contained in:
@@ -15,7 +15,7 @@ use tokio_stream::StreamExt;
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
pub struct CheckAuthArgs {
|
||||
/// The MySQL database(s) or user(s) to check authorization for
|
||||
#[arg(num_args = 1..)]
|
||||
#[arg(num_args = 1.., value_name = "NAME")]
|
||||
name: Vec<String>,
|
||||
|
||||
/// Treat the provided names as users instead of databases
|
||||
|
||||
@@ -16,7 +16,7 @@ use crate::{
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
pub struct CreateDbArgs {
|
||||
/// The MySQL database(s) to create
|
||||
#[arg(num_args = 1..)]
|
||||
#[arg(num_args = 1.., value_name = "DB_NAME")]
|
||||
name: Vec<MySQLDatabase>,
|
||||
|
||||
/// Print the information as JSON
|
||||
|
||||
@@ -17,7 +17,7 @@ use crate::{
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
pub struct CreateUserArgs {
|
||||
/// The MySQL user(s) to create
|
||||
#[arg(num_args = 1..)]
|
||||
#[arg(num_args = 1.., value_name = "USER_NAME")]
|
||||
username: Vec<MySQLUser>,
|
||||
|
||||
/// Do not ask for a password, leave it unset
|
||||
|
||||
@@ -19,7 +19,7 @@ use crate::{
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
pub struct DropDbArgs {
|
||||
/// The MySQL database(s) to drop
|
||||
#[arg(num_args = 1..)]
|
||||
#[arg(num_args = 1.., value_name = "DB_NAME")]
|
||||
#[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_database_completer)))]
|
||||
name: Vec<MySQLDatabase>,
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ use crate::{
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
pub struct DropUserArgs {
|
||||
/// The MySQL user(s) to drop
|
||||
#[arg(num_args = 1..)]
|
||||
#[arg(num_args = 1.., value_name = "USER_NAME")]
|
||||
#[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))]
|
||||
username: Vec<MySQLUser>,
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ use crate::{
|
||||
pub struct EditPrivsArgs {
|
||||
/// The MySQL database to edit privileges for
|
||||
#[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_database_completer)))]
|
||||
#[arg(value_name = "DB_NAME")]
|
||||
pub name: Option<MySQLDatabase>,
|
||||
|
||||
#[arg(
|
||||
|
||||
@@ -18,7 +18,7 @@ use crate::{
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
pub struct LockUserArgs {
|
||||
/// The MySQL user(s) to loc
|
||||
#[arg(num_args = 1..)]
|
||||
#[arg(num_args = 1.., value_name = "USER_NAME")]
|
||||
#[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))]
|
||||
username: Vec<MySQLUser>,
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ use crate::{
|
||||
pub struct PasswdUserArgs {
|
||||
/// The MySQL user whose password is to be changed
|
||||
#[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))]
|
||||
#[arg(value_name = "USER_NAME")]
|
||||
username: MySQLUser,
|
||||
|
||||
/// Read the new password from a file instead of prompting for it
|
||||
|
||||
@@ -18,7 +18,7 @@ use crate::{
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
pub struct ShowDbArgs {
|
||||
/// The MySQL database(s) to show
|
||||
#[arg(num_args = 0..)]
|
||||
#[arg(num_args = 0.., value_name = "DB_NAME")]
|
||||
#[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_database_completer)))]
|
||||
name: Vec<MySQLDatabase>,
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ use crate::{
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
pub struct ShowPrivsArgs {
|
||||
/// The MySQL database(s) to show privileges for
|
||||
#[arg(num_args = 0..)]
|
||||
#[arg(num_args = 0.., value_name = "DB_NAME")]
|
||||
#[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_database_completer)))]
|
||||
name: Vec<MySQLDatabase>,
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ use crate::{
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
pub struct ShowUserArgs {
|
||||
/// The MySQL user(s) to show
|
||||
#[arg(num_args = 0..)]
|
||||
#[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))]
|
||||
#[arg(num_args = 0.., value_name = "USER_NAME")]
|
||||
username: Vec<MySQLUser>,
|
||||
|
||||
/// Print the information as JSON
|
||||
|
||||
@@ -18,8 +18,8 @@ use crate::{
|
||||
#[derive(Parser, Debug, Clone)]
|
||||
pub struct UnlockUserArgs {
|
||||
/// The MySQL user(s) to unlock
|
||||
#[arg(num_args = 1..)]
|
||||
#[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(mysql_user_completer)))]
|
||||
#[arg(num_args = 1.., value_name = "USER_NAME")]
|
||||
username: Vec<MySQLUser>,
|
||||
|
||||
/// Print the information as JSON
|
||||
|
||||
Reference in New Issue
Block a user