Skip to content

Commit

Permalink
feat(oli): oli stat should show path as specified by users (#2842)
Browse files Browse the repository at this point in the history
Show path as specified by user.
  • Loading branch information
sarutak authored Aug 10, 2023
1 parent 2c49350 commit f17dc09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/oli/src/commands/stat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub async fn main(args: &ArgMatches) -> Result<()> {
let (op, path) = cfg.parse_location(target)?;

let meta = op.stat(&path).await?;
println!("path: {path}");
println!("path: {target}");
let size = meta.content_length();
println!("size: {size}");
if let Some(etag) = meta.etag() {
Expand Down
2 changes: 1 addition & 1 deletion bin/oli/tests/stat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async fn test_basic_stat() -> Result<()> {

let output_stdout = String::from_utf8(output)?;
let mut expected_path = "path: ".to_string();
expected_path.push_str(&dst_path.to_string_lossy()[1..]);
expected_path.push_str(&dst_path.to_string_lossy());
assert!(output_stdout.contains(&expected_path));
assert!(output_stdout.contains("size: 5"));
assert!(output_stdout.contains("type: file"));
Expand Down

0 comments on commit f17dc09

Please sign in to comment.