use clap::{CommandFactory, Parser, ValueEnum};
#[derive(Debug, Parser)]
#[command(version, about, long_about = None)]
struct Cli {
/// What mode to run the program in
#[arg(short, long, value_enum)]
mode: Mode,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
enum Mode {
/// Run swiftly
Fast,
/// Crawl slowly but steadily
///
/// This paragraph is ignored because there is no long help text for possible values.
Slow,
}
fn main() {
let mut cmd = Cli::command();
let args = std::env::args_os().collect::<Vec<_>>();
let arg_index = args.len() - 1;
let r = clap_complete::dynamic::complete(&mut cmd, args, arg_index, None).unwrap();
dbg!(r);
}
Please complete the following tasks
Rust Version
1.76
Clap Version
4.5.2
Minimal reproducible code
Steps to reproduce the bug with the above code
Actual Behaviour
The output is:
Expected Behaviour
The output should be:
Additional Context
No response
Debug Output