add clap_complete for completion support

This commit is contained in:
Mikaël Cluseau
2025-06-30 17:00:55 +02:00
parent 24a45a7825
commit 4b33c64042
3 changed files with 48 additions and 1 deletions

View File

@ -1,4 +1,4 @@
use clap::{Parser, Subcommand};
use clap::{CommandFactory, Parser, Subcommand};
use eyre::{format_err, Result};
use futures_util::StreamExt;
use tokio::io::AsyncWriteExt;
@ -54,6 +54,8 @@ enum ClusterCommand {
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<()> {
clap_complete::CompleteEnv::with_factory(Cli::command).complete();
let cli = Cli::parse();
env_logger::builder()