Add support for multi-character flag aliases and enhance argument handling
- Introduced `MULTI_CHAR_ALIASES` for mapping long flag names to multi-character short aliases. - Updated argument normalization to preprocess multi-character short-form flags. - Refactored help output to include alias visibility and improve alignment. - Enhanced CLI flag definition capabilities with better support for optional boolean arguments.
This commit is contained in:
@@ -71,12 +71,12 @@ pub struct EditArgs {
|
||||
pub name: String,
|
||||
|
||||
/// Enable or disable the self-monitor loopback.
|
||||
#[arg(short, long, value_name = "BOOL")]
|
||||
#[arg(short, long, num_args = 0..=1, default_missing_value = "true", value_name = "BOOL")]
|
||||
pub loopback: Option<bool>,
|
||||
|
||||
/// Keep a mixed-in source audible in the loopback instead of isolating
|
||||
/// it (2-node topology instead of 4).
|
||||
#[arg(long = "loopback-no-mix", value_name = "BOOL")]
|
||||
#[arg(long = "loopback-no-mix", num_args = 0..=1, default_missing_value = "true", value_name = "BOOL")]
|
||||
pub loopback_no_mix: Option<bool>,
|
||||
|
||||
/// Loopback volume: fraction (0.8) or percent (80).
|
||||
@@ -84,7 +84,7 @@ pub struct EditArgs {
|
||||
pub volume: Option<f32>,
|
||||
|
||||
/// Mixed-in source volume: fraction (0.8) or percent (80).
|
||||
#[arg(long = "source-volume", visible_alias = "sv", value_name = "PCT")]
|
||||
#[arg(long = "source-volume", value_name = "PCT")]
|
||||
pub source_volume: Option<f32>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user