Add dynamic completion for users and databases
All checks were successful
Build and test / check (push) Successful in 1m35s
Build and test / build (push) Successful in 2m46s
Build and test / test (push) Successful in 3m10s
Build and test / check-license (push) Successful in 6m12s
Build and test / docs (push) Successful in 4m39s

This commit is contained in:
2025-12-01 17:26:17 +09:00
parent cb3f3f3e1d
commit f348e67622
26 changed files with 383 additions and 17 deletions

View File

@@ -2,6 +2,7 @@ use std::path::PathBuf;
use anyhow::Context;
use clap::Parser;
use clap_complete::ArgValueCompleter;
use dialoguer::Password;
use futures_util::SinkExt;
use tokio_stream::StreamExt;
@@ -9,6 +10,7 @@ use tokio_stream::StreamExt;
use crate::{
client::commands::erroneous_server_response,
core::{
completion::mysql_user_completer,
protocol::{
ClientToServerMessageStream, ListUsersError, Request, Response,
print_set_password_output_status,
@@ -20,6 +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))]
username: MySQLUser,
/// Read the new password from a file instead of prompting for it