use perforce_cli::P4Cli;
use perforce_cli::spawn::{OutputExt1, ParameterizedSpawn};
use std::ffi::OsStr;
fn main() -> std::io::Result<()> {
let p4 = P4Cli::default();
let mut filelog = p4
.filelog()
.follow_branches(true)
.include_time(true)
.limit(10);
let files = [OsStr::new("//depot/project/...")];
let output = filelog.output(&files)?;
println!("{}", String::from_utf8_lossy(&output.stdout));
let mut long_log = p4.filelog().full_description();
let output = long_log.output(&["//depot/project/main.c@100,@120"])?;
println!("{}", String::from_utf8_lossy(&output.stdout));
let mut history = p4
.filelog()
.content_history()
.skip_promoted_tasks(true)
.changelist("4321");
let mut child = history.spawn_with((&files,))?;
child.wait()?;
Ok(())
}