mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 03:38:03 +01:00
Avoid duplicate term type in the asciicast v3 header
This commit is contained in:
@@ -66,7 +66,7 @@ pub struct Record {
|
||||
#[arg(long, short = 'I', alias = "stdin")]
|
||||
pub rec_input: bool,
|
||||
|
||||
/// List of env vars to capture [default: TERM,SHELL]
|
||||
/// List of env vars to capture [default: SHELL]
|
||||
#[arg(long, value_name = "VARS")]
|
||||
pub rec_env: Option<String>,
|
||||
|
||||
@@ -140,7 +140,7 @@ pub struct Stream {
|
||||
#[arg(long, short = 'I')]
|
||||
pub rec_input: bool,
|
||||
|
||||
/// List of env vars to capture [default: TERM,SHELL]
|
||||
/// List of env vars to capture [default: SHELL]
|
||||
#[arg(long, value_name = "VARS")]
|
||||
pub rec_env: Option<String>,
|
||||
|
||||
@@ -183,7 +183,7 @@ pub struct Session {
|
||||
#[arg(long, short = 'I')]
|
||||
pub rec_input: bool,
|
||||
|
||||
/// List of env vars to capture [default: TERM,SHELL]
|
||||
/// List of env vars to capture [default: SHELL]
|
||||
#[arg(long, value_name = "VARS")]
|
||||
pub rec_env: Option<String>,
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ impl cli::Session {
|
||||
let record_input = self.rec_input || cmd_config.rec_input;
|
||||
let term_type = self.get_term_type();
|
||||
let term_version = self.get_term_version()?;
|
||||
let env = capture_env(self.rec_env.clone(), cmd_config);
|
||||
let env = capture_env(self.rec_env.take(), cmd_config);
|
||||
|
||||
let path = self
|
||||
.output_file
|
||||
@@ -497,7 +497,7 @@ fn get_key_bindings(config: &config::Session) -> Result<KeyBindings> {
|
||||
fn capture_env(var_names: Option<String>, config: &config::Session) -> HashMap<String, String> {
|
||||
let var_names = var_names
|
||||
.or(config.rec_env.clone())
|
||||
.unwrap_or(String::from("TERM,SHELL"));
|
||||
.unwrap_or(String::from("SHELL"));
|
||||
|
||||
let vars = var_names.split(',').collect::<HashSet<_>>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user