From c0cdb946f21d64b5b6789c79e0680e9c1efcb0d7 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Sat, 30 Aug 2025 21:49:30 +0200 Subject: [PATCH] Support URLs as inputs for `cat` command --- src/cmd/cat.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cmd/cat.rs b/src/cmd/cat.rs index 4e2f1c4..19e627e 100644 --- a/src/cmd/cat.rs +++ b/src/cmd/cat.rs @@ -5,6 +5,7 @@ use anyhow::{anyhow, Result}; use crate::asciicast::{self, Asciicast, Encoder, Event, EventData, Version}; use crate::cli; +use crate::util; impl cli::Cat { pub fn run(self) -> Result<()> { @@ -49,7 +50,13 @@ impl cli::Cat { } fn open_input_files(&self) -> Result> { - self.file.iter().map(asciicast::open_from_path).collect() + self.file + .iter() + .map(|filename| { + let path = util::get_local_path(filename)?; + asciicast::open_from_path(&*path) + }) + .collect() } fn get_encoder(&self, version: Version) -> Result> {