client: add prefix completer for create-{db,user}
All checks were successful
Build and test / check-license (push) Successful in 54s
Build and test / check (push) Successful in 2m23s
Build and test / build (push) Successful in 2m55s
Build and test / test (push) Successful in 3m7s
Build and test / docs (push) Successful in 6m31s

This commit is contained in:
2025-12-16 15:27:36 +09:00
parent d814008006
commit 05b5b5dac0
6 changed files with 87 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
use clap::Parser;
use clap_complete::ArgValueCompleter;
use dialoguer::Confirm;
use futures_util::SinkExt;
use tokio_stream::StreamExt;
@@ -9,6 +10,7 @@ use crate::{
read_password_from_stdin_with_double_check,
},
core::{
completion::prefix_completer,
protocol::{
ClientToServerMessageStream, CreateUserError, Request, Response,
print_create_users_output_status, print_create_users_output_status_json,
@@ -22,6 +24,7 @@ use crate::{
pub struct CreateUserArgs {
/// The MySQL user(s) to create
#[arg(num_args = 1.., value_name = "USER_NAME")]
#[cfg_attr(not(feature = "suid-sgid-mode"), arg(add = ArgValueCompleter::new(prefix_completer)))]
username: Vec<MySQLUser>,
/// Do not ask for a password, leave it unset