feat(cli): enhance help documentation and dynamic applet dispatch
This commit is contained in:
1 parent
f1d442d798
commit
b33f01cfe1
4 files changed
+92
-26
No files matched your search
@@ -26,20 +26,38 @@ pub struct ClientArgs {
|
||||
#[command(flatten)]
|
||||
pub common: CommonClientArgs,
|
||||
|
||||
/// Event row renderer format.
|
||||
#[arg(long, value_enum, default_value_t = OutputFormat::Table)]
|
||||
/// Event row output format.
|
||||
#[arg(
|
||||
long,
|
||||
value_enum,
|
||||
default_value_t = OutputFormat::Table,
|
||||
long_help = "Event row output format.\n\nTable is the default interactive format. CSV, TSV, and JSON Lines default to all columns for structured export."
|
||||
)]
|
||||
pub format: OutputFormat,
|
||||
|
||||
/// Comma-separated event row columns.
|
||||
#[arg(short = 'c', long, value_name = "COLUMNS")]
|
||||
/// Comma-separated event row columns, or default/all.
|
||||
#[arg(
|
||||
short = 'c',
|
||||
long,
|
||||
value_name = "COLUMNS",
|
||||
long_help = "Comma-separated event row columns, or default/all.\n\nThe default table columns are compact and hide echo_sent rows. Custom table columns include all event rows. Run --list-columns to see valid names."
|
||||
)]
|
||||
pub columns: Option<String>,
|
||||
|
||||
/// Print available event row columns and exit.
|
||||
#[arg(long)]
|
||||
/// List available event row columns and aliases, then exit.
|
||||
#[arg(
|
||||
long,
|
||||
long_help = "List available event row columns and aliases, then exit.\n\nA server argument is not required when listing columns."
|
||||
)]
|
||||
pub list_columns: bool,
|
||||
|
||||
/// Header policy for table, CSV, and TSV output.
|
||||
#[arg(long, value_enum, default_value_t = HeaderMode::Auto)]
|
||||
#[arg(
|
||||
long,
|
||||
value_enum,
|
||||
default_value_t = HeaderMode::Auto,
|
||||
long_help = "Header policy for table, CSV, and TSV output.\n\nJSON Lines never prints a header."
|
||||
)]
|
||||
pub header: HeaderMode,
|
||||
|
||||
/// Include extra fields in table output and final summaries.
|
||||
|
||||
@@ -129,17 +129,19 @@ impl OutputConfig {
|
||||
writeln!(out, " {:<24} {}", column.name(), column.description()).unwrap();
|
||||
}
|
||||
writeln!(out).unwrap();
|
||||
writeln!(out, "Aliases:").unwrap();
|
||||
writeln!(out, " receive_delay, receive_delay_us").unwrap();
|
||||
writeln!(out, " send_delay, send_delay_us").unwrap();
|
||||
writeln!(out, " server_processing").unwrap();
|
||||
writeln!(out, " server_received_count, server_received_window").unwrap();
|
||||
writeln!(out).unwrap();
|
||||
writeln!(out, "Special column sets:").unwrap();
|
||||
writeln!(
|
||||
out,
|
||||
"Aliases: rd=receive_delay, sd=send_delay, proc=server_processing, \
|
||||
server_received=server_received_count, server_window=server_received_window."
|
||||
)
|
||||
.unwrap();
|
||||
writeln!(
|
||||
out,
|
||||
"Use --columns default for the format default, or --columns all for every column."
|
||||
" default format default; compact for table, all columns for csv/tsv/jsonl"
|
||||
)
|
||||
.unwrap();
|
||||
writeln!(out, " all every column").unwrap();
|
||||
out
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user