command.CommandSummary
Rust
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- command
- Package
- libtmux
- Source
- crates/libtmux/src/command.rs
-
A rendering of a dispatched command that is safe to log.
Every public token is ASCII escaped. Sensitive arguments are represented by a fixed marker that discloses neither their bytes nor their length.
Examples
use libtmux::Command;let guard = libtmux::test::TestServer::new().await?;let result = guard.server().cmd(Command::new("set-environment").arg("-g").arg("TOKEN").sensitive_arg("hunter2"),).await?;// The subcommand is not an argument, so this counts `-g`, `TOKEN`, and// the secret.let summary = result.command();assert_eq!(summary.argument_count(), 3);assert_eq!(summary.public_argument_count(), 2);// The secret is neither shown nor measurable from what is shown.let rendered = summary.to_string();assert!(!rendered.contains("hunter2"), "{rendered}");assert!(!format!("{summary:?}").contains("hunter2"));guard.shutdown().await?;
3 declared, 0 inherited
Members
- argument_count method Return the number of logical arguments after the subcommand.
- public_argument_count method Return the number of public logical arguments.
- sensitive_argument_count method Return the number of sensitive logical arguments.