mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-15 19:28:00 +01:00
Rename options related to input and env var capture
This commit is contained in:
40
src/cli.rs
40
src/cli.rs
@@ -127,24 +127,24 @@ pub struct Record {
|
||||
)]
|
||||
pub command: Option<String>,
|
||||
|
||||
/// Enable recording of keyboard input in addition to terminal output. When enabled, both what you type and what appears on the screen will be captured. Note that sensitive input like passwords will also be recorded when this option is enabled. Can also be set via the config file option recording.rec_input.
|
||||
/// Enable recording of keyboard input in addition to terminal output. When enabled, both what you type and what appears on the screen will be captured. Note that sensitive input like passwords will also be recorded when this option is enabled. Can also be set via the config file option recording.cap_input.
|
||||
#[arg(
|
||||
long,
|
||||
short = 'I',
|
||||
alias = "stdin",
|
||||
help = "Enable input (keyboard) recording",
|
||||
help = "Enable input (keyboard) capture",
|
||||
long_help
|
||||
)]
|
||||
pub rec_input: bool,
|
||||
pub cap_input: bool,
|
||||
|
||||
/// Specify which environment variables to capture and include in the recording metadata. This helps ensure the recording context is preserved, e.g., for auditing. Provide a comma-separated list of variable names, for example: --rec-env "USER,SHELL,TERM". If not specified, only the SHELL variable is captured by default. Can also be set via the config file option recording.rec_env.
|
||||
/// Specify which environment variables to capture and include in the recording metadata. This helps ensure the recording context is preserved, e.g., for auditing. Provide a comma-separated list of variable names, for example: --rec-env "USER,SHELL,TERM". If not specified, only the SHELL variable is captured by default. Can also be set via the config file option recording.cap_env.
|
||||
#[arg(
|
||||
long,
|
||||
value_name = "VARS",
|
||||
help = "Comma-separated list of environment variables to capture [default: SHELL]",
|
||||
long_help
|
||||
)]
|
||||
pub rec_env: Option<String>,
|
||||
pub cap_env: Option<String>,
|
||||
|
||||
/// Append the new session to an existing recording file instead of creating a new one. This allows you to continue a previous recording session. The timing will be adjusted to maintain continuity from where the previous recording ended. Cannot be used together with --overwrite.
|
||||
#[arg(short, long, help = "Append to an existing recording file", long_help)]
|
||||
@@ -266,23 +266,18 @@ pub struct Stream {
|
||||
)]
|
||||
pub command: Option<String>,
|
||||
|
||||
/// Enable recording of keyboard input in addition to terminal output. When enabled, both what you type and what appears on the screen will be captured. Note that sensitive input like passwords will also be recorded when this option is enabled. If the server has stream recording enabled then keyboard input will be included in the recording file created on the server side. Can also be set via the config file option recording.rec_input.
|
||||
#[arg(
|
||||
long,
|
||||
short = 'I',
|
||||
help = "Enable input (keyboard) recording",
|
||||
long_help
|
||||
)]
|
||||
pub rec_input: bool,
|
||||
/// Enable recording of keyboard input in addition to terminal output. When enabled, both what you type and what appears on the screen will be captured. Note that sensitive input like passwords will also be recorded when this option is enabled. If the server has stream recording enabled then keyboard input will be included in the recording file created on the server side. Can also be set via the config file option recording.cap_input.
|
||||
#[arg(long, short = 'I', help = "Enable input (keyboard) capture", long_help)]
|
||||
pub cap_input: bool,
|
||||
|
||||
/// Specify which environment variables to capture and include in the stream metadata. Provide a comma-separated list of variable names, for example: --rec-env "USER,SHELL,TERM". If not specified, only the SHELL variable is captured by default. If the server has stream recording enabled then these environment variables will be included in the recording file created on the server side. Can also be set via the config file option recording.rec_env.
|
||||
/// Specify which environment variables to capture and include in the stream metadata. Provide a comma-separated list of variable names, for example: --rec-env "USER,SHELL,TERM". If not specified, only the SHELL variable is captured by default. If the server has stream recording enabled then these environment variables will be included in the recording file created on the server side. Can also be set via the config file option recording.cap_env.
|
||||
#[arg(
|
||||
long,
|
||||
value_name = "VARS",
|
||||
help = "Comma-separated list of environment variables to capture [default: SHELL]",
|
||||
long_help
|
||||
)]
|
||||
pub rec_env: Option<String>,
|
||||
pub cap_env: Option<String>,
|
||||
|
||||
/// Set a descriptive title for the streaming session. This title is displayed to viewers (when doing remote streaming with --remote). For example: --title "Building a REST API". If the server has stream recording enabled then the title will be included in the recording file created on the server side.
|
||||
#[arg(short, long, help = "Title of the session", long_help)]
|
||||
@@ -354,23 +349,18 @@ pub struct Session {
|
||||
)]
|
||||
pub command: Option<String>,
|
||||
|
||||
/// Enable recording of keyboard input in addition to terminal output. When enabled, both what you type and what appears on the screen will be captured. Note that sensitive input like passwords will also be recorded when this option is enabled. If the server has stream recording enabled then keyboard input will be included in the recording file created on the server side. Can also be set via the config file option recording.rec_input.
|
||||
#[arg(
|
||||
long,
|
||||
short = 'I',
|
||||
help = "Enable input (keyboard) recording",
|
||||
long_help
|
||||
)]
|
||||
pub rec_input: bool,
|
||||
/// Enable recording of keyboard input in addition to terminal output. When enabled, both what you type and what appears on the screen will be captured. Note that sensitive input like passwords will also be recorded when this option is enabled. If the server has stream recording enabled then keyboard input will be included in the recording file created on the server side. Can also be set via the config file option recording.cap_input.
|
||||
#[arg(long, short = 'I', help = "Enable input (keyboard) capture", long_help)]
|
||||
pub cap_input: bool,
|
||||
|
||||
/// Specify which environment variables to capture and include in the session metadata. Provide a comma-separated list of variable names, for example: --rec-env "USER,SHELL,TERM". If not specified, only the SHELL variable is captured by default. If the server has stream recording enabled then these environment variables will be included in the recording file created on the server side. Can also be set via config file option recording.rec_env.
|
||||
/// Specify which environment variables to capture and include in the session metadata. Provide a comma-separated list of variable names, for example: --rec-env "USER,SHELL,TERM". If not specified, only the SHELL variable is captured by default. If the server has stream recording enabled then these environment variables will be included in the recording file created on the server side. Can also be set via config file option recording.cap_env.
|
||||
#[arg(
|
||||
long,
|
||||
value_name = "VARS",
|
||||
help = "Comma-separated list of environment variables to capture [default: SHELL]",
|
||||
long_help
|
||||
)]
|
||||
pub rec_env: Option<String>,
|
||||
pub cap_env: Option<String>,
|
||||
|
||||
/// Append the new session to an existing recording file instead of creating a new one. This allows you to continue a previous recording session. The timing will be adjusted to maintain continuity from where the previous recording ended. Cannot be used together with --overwrite. Only applies when --output-file is specified.
|
||||
#[arg(short, long, help = "Append to an existing recording file", long_help)]
|
||||
|
||||
@@ -131,7 +131,7 @@ impl cli::Session {
|
||||
command,
|
||||
extra_env,
|
||||
tty.as_mut(),
|
||||
self.rec_input || config.recording.rec_input,
|
||||
self.cap_input || config.recording.cap_input,
|
||||
outputs,
|
||||
keys,
|
||||
notifier,
|
||||
@@ -171,7 +171,7 @@ impl cli::Session {
|
||||
idle_time_limit: self.idle_time_limit.or(config.idle_time_limit),
|
||||
command: self.get_command(config),
|
||||
title: self.title.clone(),
|
||||
env: capture_env(self.rec_env.clone(), config),
|
||||
env: capture_env(self.cap_env.clone(), config),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ fn get_key_bindings(config: &config::Recording) -> Result<KeyBindings> {
|
||||
|
||||
fn capture_env(var_names: Option<String>, config: &config::Recording) -> HashMap<String, String> {
|
||||
let var_names = var_names
|
||||
.or(config.rec_env.clone())
|
||||
.or(config.cap_env.clone())
|
||||
.unwrap_or(String::from("SHELL"));
|
||||
|
||||
let vars = var_names.split(',').collect::<HashSet<_>>();
|
||||
|
||||
@@ -35,8 +35,8 @@ pub struct Server {
|
||||
#[allow(unused)]
|
||||
pub struct Recording {
|
||||
pub command: Option<String>,
|
||||
pub rec_input: bool,
|
||||
pub rec_env: Option<String>,
|
||||
pub cap_input: bool,
|
||||
pub cap_env: Option<String>,
|
||||
pub idle_time_limit: Option<f64>,
|
||||
pub prefix_key: Option<String>,
|
||||
pub pause_key: Option<String>,
|
||||
@@ -65,7 +65,7 @@ impl Config {
|
||||
let mut config = config::Config::builder()
|
||||
.set_default("server.url", None::<Option<String>>)?
|
||||
.set_default("playback.speed", None::<Option<f64>>)?
|
||||
.set_default("recording.rec_input", false)?
|
||||
.set_default("recording.cap_input", false)?
|
||||
.set_default("notifications.enabled", true)?
|
||||
.add_source(File::with_name("/etc/asciinema/config.toml").required(false))
|
||||
.add_source(File::with_name(&user_defaults_path()?.to_string_lossy()).required(false))
|
||||
|
||||
@@ -43,12 +43,12 @@ fn main() -> ExitCode {
|
||||
Commands::Record(cmd) => {
|
||||
let cmd = Session {
|
||||
output_file: Some(cmd.file),
|
||||
rec_input: cmd.rec_input,
|
||||
cap_input: cmd.cap_input,
|
||||
append: cmd.append,
|
||||
output_format: cmd.output_format,
|
||||
overwrite: cmd.overwrite,
|
||||
command: cmd.command,
|
||||
rec_env: cmd.rec_env,
|
||||
cap_env: cmd.cap_env,
|
||||
title: cmd.title,
|
||||
idle_time_limit: cmd.idle_time_limit,
|
||||
headless: cmd.headless,
|
||||
@@ -67,12 +67,12 @@ fn main() -> ExitCode {
|
||||
Commands::Stream(cmd) => {
|
||||
let cmd = Session {
|
||||
output_file: None,
|
||||
rec_input: cmd.rec_input,
|
||||
cap_input: cmd.cap_input,
|
||||
append: false,
|
||||
output_format: None,
|
||||
overwrite: false,
|
||||
command: cmd.command,
|
||||
rec_env: cmd.rec_env,
|
||||
cap_env: cmd.cap_env,
|
||||
title: cmd.title,
|
||||
idle_time_limit: None,
|
||||
headless: cmd.headless,
|
||||
|
||||
Reference in New Issue
Block a user